Skip to content

Commit 0f3e2bc

Browse files
committed
Use OIDC federated credentials for migration workflows
1 parent 91cb8cb commit 0f3e2bc

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

.github/workflows/deploy_to_staging.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ on:
1616
jobs:
1717
run_migrations:
1818
name: Update database in Staging
19+
permissions:
20+
contents: read
21+
pull-requests: read
22+
id-token: write
1923
uses: equinor/armada/.github/workflows/run_dotnet_migrations.yml@main
2024
with:
2125
environment: Staging
2226
checkout_ref: ${{ github.event.release.tag_name }}
2327
working_directory: api
24-
secrets:
25-
client_id: ${{ secrets.CLIENTID }}
26-
client_secret: ${{ secrets.CLIENTSECRET }}
28+
azure_client_id: ${{ secrets.CLIENTID }}
29+
azure_subscription_id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
2730

2831
build-and-push-latest-release-images-to-ghcr:
2932
name: Build and push latest release images to github container registry

.github/workflows/promote_to_production.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ jobs:
3939
run_migrations:
4040
name: Update database in Production
4141
needs: get_staging_version
42+
permissions:
43+
contents: read
44+
pull-requests: read
45+
id-token: write
4246
uses: equinor/armada/.github/workflows/run_dotnet_migrations.yml@main
4347
with:
4448
environment: Production
4549
checkout_ref: ${{ needs.get_staging_version.outputs.versionTag }}
4650
working_directory: api
47-
secrets:
48-
client_id: ${{ secrets.CLIENTID }}
49-
client_secret: ${{ secrets.CLIENTSECRET }}
51+
azure_client_id: ${{ secrets.CLIENTID }}
52+
azure_subscription_id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
5053

5154
deploy:
5255
name: Update deployment in Production

.github/workflows/run_development_migrations.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
permissions:
1515
contents: read
1616
pull-requests: read
17+
id-token: write
1718
with:
1819
environment: Development
1920
working_directory: api
20-
secrets:
21-
client_id: ${{ secrets.CLIENTID }}
22-
client_secret: ${{ secrets.CLIENTSECRET }}
21+
azure_client_id: ${{ secrets.CLIENTID }}
22+
azure_subscription_id: ${{ vars.AZURE_SUBSCRIPTION_ID }}

0 commit comments

Comments
 (0)