Git tags #70
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow | |
name: "Git tags" | |
on: # yamllint disable-line rule:truthy | |
delete: null | |
push: | |
tags: | |
- "**" | |
workflow_call: null | |
permissions: {} # yamllint disable-line rule:braces | |
#permissions: "read-all" | |
#permissions: | |
# contents: "read" # Private repositories need read permission | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
double_tag: | |
name: "Tag without new commit" | |
runs-on: "ubuntu-22.04" | |
timeout-minutes: 1 | |
steps: | |
- | |
name: "Checkout repository" | |
uses: "actions/[email protected]" | |
with: | |
fetch-depth: 0 | |
- | |
name: "List commits with multiple tags" | |
run: | | |
DUPLICATES="$(git show-ref --tags --hash=7 | sort | uniq --repeated)" | |
if [ -n "${DUPLICATES}" ]; then | |
echo "::error::Commit with multiple tags" | |
echo "${DUPLICATES}" | |
exit 10 | |
fi |