actions: add context example

This commit is contained in:
Earl Warren 2024-01-05 19:37:15 +01:00
parent c5cccca38d
commit 4768908489
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
8 changed files with 240 additions and 4 deletions

View file

@ -33,6 +33,24 @@ jobs:
echo value=true >> $GITHUB_OUTPUT
fi
# See also actions/example-context/.forgejo/workflows/test.yml
- name: env.GITHUB_BASE_REF
run: |
set -x
test "$GITHUB_BASE_REF" = main
test "$GITHUB_BASE_REF" = "${{ env.GITHUB_BASE_REF }}"
# See also actions/example-context/.forgejo/workflows/test.yml
- name: env.GITHUB_HEAD_REF
run: |
set -x
if ${{ steps.forked.outputs.value }} ; then
test "$GITHUB_HEAD_REF" = main
else
test "$GITHUB_HEAD_REF" = other
fi
test "$GITHUB_HEAD_REF" = "${{ env.GITHUB_HEAD_REF }}"
- name: secrets
shell: bash
run: |