Skip to content

Remove arm move missions #8

Remove arm move missions

Remove arm move missions #8

Workflow file for this run

name: Run migrations

Check failure on line 1 in .github/workflows/runMigrations.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/runMigrations.yml

Invalid workflow file

(Line: 4, Col: 3): Unexpected value 'pull_requests'
permissions:
contents: read
pull_requests: read
on:
workflow_call:
inputs:
PullRequestCheckout:
required: false
type: boolean
Environment:
required: true
type: string
CheckoutRef:
required: false
type: string
default: "main"
secrets:
ClientId:
required: true
ClientSecret:
required: true
defaults:
run:
working-directory: backend/api
jobs:
run_migrations:
environment: ${{ inputs.Environment }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.CheckoutRef }}
# Checks out to main branch by default, so we need to manually checkout to the PR the comment was made on
# in order to do the update database on the new migrations.
# We don't have the ref in the IssueComment trigger so we need to check out the pr number
- name: Fetch PR head SHA
if: ${{ inputs.PullRequestCheckout }}
id: pr_head_sha
run: |
PR_SHA=$(gh pr view ${{ github.event.issue.number }} --json headRefOid -q ".headRefOid")
echo "pr_head_sha=$PR_SHA" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Pull Request by SHA
if: ${{ inputs.PullRequestCheckout }}
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ steps.pr_head_sha.outputs.pr_head_sha }}
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Build project and dependencies
run: dotnet build
- name: Install dotnet ef tool
run: dotnet tool install -g dotnet-ef --version 8.0.11
- name: Update database
run: dotnet ef database update --no-build --verbose
env:
AZURE_CLIENT_ID: ${{ secrets.ClientId }}
AZURE_CLIENT_SECRET: ${{ secrets.ClientSecret }}
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
ASPNETCORE_ENVIRONMENT: ${{ vars.AspNetEnvironment }}