From 7998520e4a57e2aaca20219049cc8d33506ab98f Mon Sep 17 00:00:00 2001 From: Mike Kinney Date: Mon, 7 Mar 2022 21:59:46 -0800 Subject: [PATCH] keep sha ref and use it for subsequent checkouts --- .github/workflows/release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b890e2..f9b5880 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,7 @@ jobs: outputs: version: ${{ steps.get_version.outputs.version }} upload_url: ${{ steps.create_release.outputs.upload_url }} + new_sha: ${{ steps.commit_updated.outputs.sha }} steps: @@ -19,12 +20,14 @@ jobs: bin/bump_version.py - name: Commit updated version.py + id: commit_updated run: | git config --global user.name 'github-actions' git config --global user.email 'bot@noreply.github.com' git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} git add setup.py git commit -m "bump version" && git push || echo "No changes to commit" + git log -n 1 --pretty=format:"%h" | tail -n 1 | awk '{print "::set-output name=sha::"$0}' - name: Get version id: get_version @@ -80,6 +83,8 @@ jobs: - name: Checkout uses: actions/checkout@v2 + with: + ref: ${{ needs.release_create.outputs.new_sha }} - name: Set up Python 3.9 uses: actions/setup-python@v2 @@ -125,6 +130,8 @@ jobs: - name: Checkout uses: actions/checkout@v2 + with: + ref: ${{ needs.release_create.outputs.new_sha }} - name: Set up Python 3.9 uses: actions/setup-python@v2 @@ -165,6 +172,8 @@ jobs: - name: Checkout uses: actions/checkout@v2 + with: + ref: ${{ needs.release_create.outputs.new_sha }} - name: Set up Python 3.9 uses: actions/setup-python@v2