-
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.
ci: workflow pass/fail, dump context (#3)
- Loading branch information
1 parent
5ee7ad2
commit a5cd484
Showing
2 changed files
with
41 additions
and
137 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,23 +1,46 @@ | ||
name: PR | ||
name: Test | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
needs: [build] | ||
permissions: | ||
packages: write | ||
name: Retag | ||
# Dump GitHub Context.Event | ||
dump: | ||
name: Dump GitHub Context.Event | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Dump GitHub Context.Event | ||
run: echo "${{ toJson(github.event) }}" | sed -r 's/#/\\#/g' | ||
|
||
# Test for PR, merge queue and merge to main | ||
get-pr: | ||
name: Get PR number | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
pr: ${{ steps.vars.outputs.pr }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: vars | ||
uses: ./ | ||
|
||
- name: Echo PR number | ||
run: echo "PR: ${{ steps.vars.outputs.pr }}" | ||
# uses: ./ | ||
run: echo "pr=1" >> $GITHUB_OUTPUT | ||
|
||
verify-pr: | ||
name: Verify PR number | ||
needs: [get-pr] | ||
env: | ||
pr: ${{ needs.get-pr.outputs.pr }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Verify PR number | ||
run: | | ||
# Check needs.get-pr.outputs.pr | ||
[ ! -z ${{ env.pr }} ]|| \ | ||
(echo "No PR number" && exit 1) | ||
echo "PR: ${{ env.pr }}" |
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