32 lines
1.1 KiB
YAML
32 lines
1.1 KiB
YAML
# Cut the next major tag (vN) when a Renovate bump of a pinned tool lands on
|
|
# main, so the pipelines get it through their own Renovate PR ("update
|
|
# ci-actions to vN"). Only renovate-bot's merges: hand-made changes keep
|
|
# being tagged by hand, with the README note.
|
|
name: tag
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
tag:
|
|
if: github.actor == 'renovate-bot'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Next vN on HEAD
|
|
run: |
|
|
set -euo pipefail
|
|
git fetch -q --tags
|
|
if git tag --points-at HEAD | grep -qE '^v[0-9]+$'; then
|
|
echo "HEAD already tagged: $(git tag --points-at HEAD | tr '\n' ' ')"; exit 0
|
|
fi
|
|
last=$(git tag -l 'v[0-9]*' | grep -E '^v[0-9]+$' | sed 's/^v//' | sort -n | tail -1)
|
|
next="v$((${last:-0} + 1))"
|
|
git tag "$next" HEAD
|
|
git push origin "refs/tags/$next"
|
|
echo "tagged $next on $(git rev-parse --short HEAD): $(git log -1 --format=%s)"
|