Skip to content

Commit

Permalink
Add secret
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMind committed Jun 25, 2024
1 parent 62a08f2 commit a1efd5a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ jobs:
call_worker:
needs: context
uses: ./.github/workflows/worker.yml
secrets:
token: ${{ github.token }}
with:
boolean: ${{ fromJson(needs.context.outputs.boolean) }}
number: ${{ fromJson(needs.context.outputs.number) }}
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ on:
workflow_output2:
description: "The second job output"
value: ${{ jobs.output.outputs.two }}
secrets:
token:
description: 'A token passed from the caller workflow'
required: false

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
Expand All @@ -42,6 +46,20 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/context

secret:
env:
github_secret: ${{ github.event.workflow_call.secrets.token }}
secret: ${{ secrets.token }}
runs-on: ubuntu-latest
steps:
- shell: bash
run: |
set -x
echo "env.secret: ${{ env.secret }}"
echo "contains(env, 'secret'): ${{ contains(env, 'secret') }}"
echo "env.github_secret: ${{ env.github_secret }}"
echo "contains(env, 'github_secret'): ${{ contains(env, 'github_secret') }}"
output:
runs-on: ubuntu-latest

Expand Down

0 comments on commit a1efd5a

Please sign in to comment.