Skip to content

Commit

Permalink
♻️ Refactor Vercel secrets handling in GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cermakjiri committed Nov 22, 2024
1 parent 1d5e53c commit 8f8e421
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,24 @@ on:
branches:
- dev

workflow_call:
secrets:
VERCEL_NAME_EXAMPLE_DEFAULT:
required: true
VERCEL_NAME_EXAMPLE_UPGRADE:
required: true
VERCEL_SCOPE:
required: true
VERCEL_TOKEN:
required: true
SENTRY_AUTH_TOKEN:
required: true
env:
VERCEL_NAME_EXAMPLE_DEFAULT: ${ secrets.VERCEL_NAME_EXAMPLE_DEFAULT }}
VERCEL_NAME_EXAMPLE_UPGRADE: ${ secrets.VERCEL_NAME_EXAMPLE_UPGRADE }}
VERCEL_SCOPE: ${ secrets.VERCEL_SCOPE }}
VERCEL_TOKEN: ${ secrets.VERCEL_TOKEN }}
SENTRY_AUTH_TOKEN: ${ secrets.SENTRY_AUTH_TOKEN }}

jobs:
default-example:
uses: ./.github/workflows/preview-common.yaml
secrets:
vercel_project_name: ${{ secrets.VERCEL_NAME_EXAMPLE_DEFAULT }}
vercel_scope: ${{ secrets.VERCEL_SCOPE }}
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_project_name: $VERCEL_NAME_EXAMPLE_DEFAULT
vercel_scope: $VERCEL_SCOPE
vercel_token: $VERCEL_TOKEN

upgrade-example:
uses: ./.github/workflows/preview-common.yaml
secrets:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_project_name: ${{ secrets.VERCEL_NAME_EXAMPLE_UPGRADE }}
vercel_scope: ${{ secrets.VERCEL_SCOPE }}
vercel_token: $VERCEL_TOKEN
vercel_project_name: $VERCEL_NAME_EXAMPLE_UPGRADE
vercel_scope: $VERCEL_SCOPE

0 comments on commit 8f8e421

Please sign in to comment.