Skip to content

Instantly share code, notes, and snippets.

@LucianBuzzo
Created April 6, 2023 08:58
Show Gist options
  • Select an option

  • Save LucianBuzzo/9a28966e8d21cca3022916650ee4430b to your computer and use it in GitHub Desktop.

Select an option

Save LucianBuzzo/9a28966e8d21cca3022916650ee4430b to your computer and use it in GitHub Desktop.
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