Created
April 6, 2023 08:58
-
-
Save LucianBuzzo/9a28966e8d21cca3022916650ee4430b to your computer and use it in GitHub Desktop.
This file contains hidden or 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: Tagged Commit Check | |
| on: | |
| pull_request: | |
| branches: | |
| - <protected_branch_name> | |
| jobs: | |
| check-tagged-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check if commit is tagged | |
| run: | | |
| git fetch --tags | |
| TAGGED_COMMIT=$(git tag --points-at ${{ github.event.pull_request.head.sha }}) | |
| if [[ -z "$TAGGED_COMMIT" ]]; then | |
| echo "error: Commit not tagged" | |
| exit 1 | |
| else | |
| echo "success: Commit is tagged" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment