Ensure all PRs to release to be tagged.
Will be enforced via branch protection.
This commit is contained in:
parent
3cac0a9258
commit
992ee014a3
26
.github/workflows/ensure-release-tagged.yaml
vendored
Normal file
26
.github/workflows/ensure-release-tagged.yaml
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
name: Ensure Tagged Commits on Release
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- release
|
||||
|
||||
jobs:
|
||||
check_tag:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check if base commit of PR is tagged
|
||||
run: |
|
||||
BASE_COMMIT=$(jq -r .pull_request.base.sha < "$GITHUB_EVENT_PATH")
|
||||
TAG=$(git tag --contains $BASE_COMMIT)
|
||||
if [ -z "$TAG" ]; then
|
||||
echo "Base commit of PR is not tagged. PRs onto release must be tagged with the version number."
|
||||
exit 1
|
||||
fi
|
||||
echo "Base commit of PR is tagged. Check passed."
|
||||
|
Loading…
Reference in New Issue
Block a user