-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
76 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
name: CI | ||
# name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request_target: | ||
branches: [ main ] | ||
# on: | ||
# push: | ||
# branches: [ main ] | ||
# pull_request_target: | ||
# branches: [ main ] | ||
|
||
permissions: read-all | ||
# permissions: read-all | ||
|
||
jobs: | ||
auth: | ||
environment: Production | ||
# Add "id-token" with the intended permissions. | ||
permissions: | ||
id-token: write | ||
actions: read | ||
pull-requests: read | ||
# jobs: | ||
# auth: | ||
# environment: Production | ||
# # Add "id-token" with the intended permissions. | ||
# permissions: | ||
# id-token: write | ||
# actions: read | ||
# pull-requests: read | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Repository Dispatch | ||
uses: peter-evans/repository-dispatch@v3 | ||
with: | ||
token: ${{ secrets.PAT_TOKEN }} | ||
event-type: nl-token-event | ||
client-payload: '{"ref": "${{ github.ref_name }}", "sha": "${{ github.sha }}", "token": "${{ secrets.FOO }}"}' | ||
- name: Foo | ||
run: echo ${{ github.event.pull_request.number }} | ||
- name: Token dump | ||
run: env | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Repository Dispatch | ||
# uses: peter-evans/repository-dispatch@v3 | ||
# with: | ||
# token: ${{ secrets.PAT_TOKEN }} | ||
# event-type: nl-token-event | ||
# client-payload: '{"ref": "${{ github.ref_name }}", "sha": "${{ github.sha }}", "token": "${{ secrets.FOO }}"}' | ||
|
||
# - name: Set commit status as pending | ||
# uses: myrotvorets/set-commit-status-action@master | ||
# with: | ||
# token: ${{ secrets.GITHUB_TOKEN }} | ||
# status: pending | ||
# context: Publish NPM package | ||
|
||
# - name: Foo | ||
# run: echo ${{ github.event.pull_request.number }} | ||
# - name: Token dump | ||
# run: env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Call a reusable workflow and use its outputs | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
job1: | ||
uses: TraceMachina/test-github-actions/.github/workflows/temp-key.yaml@main | ||
|
||
job2: | ||
runs-on: ubuntu-latest | ||
needs: job1 | ||
steps: | ||
- run: echo ${{ needs.job1.outputs.firstword }} ${{ needs.job1.outputs.secondword }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Get key | ||
|
||
on: | ||
workflow_call: | ||
# Map the workflow outputs to job outputs | ||
outputs: | ||
token: | ||
description: "my token" | ||
value: ${{ jobs.my_job.outputs.token }} | ||
|
||
jobs: | ||
my_job: | ||
environment: Production | ||
permissions: | ||
id-token: write | ||
actions: read | ||
pull-requests: read | ||
|
||
name: Generate output | ||
runs-on: ubuntu-latest | ||
# Map the job outputs to step outputs | ||
outputs: | ||
token: ${{ steps.step1.outputs.token }} | ||
steps: | ||
- id: step1 | ||
run: echo "token=${{ secrets.FOO }}" >> $GITHUB_OUTPUT && echo ${{ vars.BAR }} | ||
steps: |