keep sha ref and use it for subsequent checkouts

This commit is contained in:
Mike Kinney
2022-03-07 21:59:46 -08:00
parent 22f43851bd
commit 7998520e4a

View File

@@ -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