From 59ccd3520c1753e06fb2cc79d0e20ca696ae9737 Mon Sep 17 00:00:00 2001 From: Bernhard Frauendienst Date: Mon, 15 Jul 2024 16:27:18 +0200 Subject: [PATCH] Add demo action for actions/checkout #1782 https://github.com/actions/checkout/issues/1782 --- .github/workflows/demo.yaml | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/demo.yaml diff --git a/.github/workflows/demo.yaml b/.github/workflows/demo.yaml new file mode 100644 index 0000000..b93d65c --- /dev/null +++ b/.github/workflows/demo.yaml @@ -0,0 +1,59 @@ +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 }} + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Create dummy commit, and push as non-standard ref + id: push + run: | + 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/checkout@v4.1.6 + 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 +