Skip to content

Commit

Permalink
Add .github/workflows/auto_tag_stable.yml
Browse files Browse the repository at this point in the history
This workflow automatically updates and pushes the 'stable' tag
when commits are pushed to the branch pointed by
/~https://github.com/OSGeo/PROJ/settings/variables/actions/STABLE_BRANCH
  • Loading branch information
rouault committed Nov 16, 2024
1 parent a098595 commit 9dae7b8
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/auto_tag_stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Update Stable Tag

on:
push:
branches:
- '**' # Matches all branches

permissions:
contents: read

jobs:
update-stable-tag:
runs-on: ubuntu-latest
if: github.repository == 'OSGeo/PROJ'
permissions:
contents: write
steps:
- name: Check branch match
id: check_branch
env:
STABLE_BRANCH: ${{ vars.STABLE_BRANCH }} # Repository variable
run: |
echo "Push detected on branch $GITHUB_REF"
if [[ "${GITHUB_REF#refs/heads/}" != "${STABLE_BRANCH}" ]]; then
echo "This workflow only runs for branch $STABLE_BRANCH. Skipping further steps."
echo "::set-output name=run::false"
else
echo "::set-output name=run::true"
fi
- name: Checkout code
if: steps.check_branch.outputs.run == 'true'
uses: actions/checkout@v4

- name: Tag
if: steps.check_branch.outputs.run == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git tag -f stable
git push -f origin stable

0 comments on commit 9dae7b8

Please sign in to comment.