-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add demo action for actions/checkout #1782
- Loading branch information
0 parents
commit 63769a8
Showing
1 changed file
with
64 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Demo for non-standard ref names issue | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
push_ref: | ||
name: Create non-standard ref name | ||
runs-on: ubuntu-latest | ||
outputs: | ||
ref: ${{ steps.push.outputs.ref }} | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create dummy commit, and push as non-standard ref | ||
id: push | ||
run: | | ||
git config user.name 'github-actions[bot]' | ||
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
echo "Dummy" > dummy | ||
git add dummy | ||
git commit -m 'Dummy commit (run id ${{ github.run_id }})' | ||
git push origin HEAD:$REF | ||
echo "ref=$REF" >> $GITHUB_OUTPUTS | ||
env: | ||
REF: "refs/deploy-bot/${{ github.run_id }}/merge" | ||
|
||
checkout_old_working: | ||
name: Checkout non-standard ref name (working @4.1.6) | ||
runs-on: ubuntu-latest | ||
needs: push_ref | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ needs.push_ref.outputs.ref }} | ||
|
||
- name: Show latest commit | ||
run: | | ||
git log -1 | ||
cat dummy | ||
checkout_new_failing: | ||
name: Checkout non-standard ref name (failing @ > 4.1.6) | ||
runs-on: ubuntu-latest | ||
needs: push_ref | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.push_ref.outputs.ref }} | ||
|
||
- name: Show latest commit | ||
run: | | ||
git log -1 | ||
cat dummy | ||