Workaround cibuildwheel macos post-testing bug #18
Workflow file for this run
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
name: Tag PR | |
on: | |
pull_request: | |
types: closed | |
jobs: | |
tag: | |
# This could be flaky for forks - need to check both repos are the same but PR11 skipped with that check and YAGNI right now | |
if: github.event.pull_request.merged | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: create tag git ref | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/pr${{ github.event.number }}', | |
sha: '${{ github.event.pull_request.head.sha }}' | |
}).catch(err => { | |
if (err.status !== 409) throw err; | |
github.rest.git.updateRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/pr${{ github.event.number }}', | |
sha: '${{ github.event.pull_request.head.sha }}' | |
}); | |
}) |