Skip to content

Commit

Permalink
Merge pull request #4326 from OSGeo/backport-4323-to-master
Browse files Browse the repository at this point in the history
[Backport master] [9.5 branch ] Add .github/workflows/auto_tag_stable.yml
  • Loading branch information
rouault authored Nov 18, 2024
2 parents c936171 + e8856d3 commit 25ee5a5
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/auto_tag_stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Update Stable Tag

on:
push:
branches:
- '**' # Matches all branches, but we later filter on the one matching the STABLE_BRANCH repository variable

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 "run=false" >> $GITHUB_OUTPUT
else
echo "run=true" >> $GITHUB_OUTPUT
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 config --global user.email "[email protected]"
git config --global user.name "PROJ-bot"
touch .dummy-file
git add .dummy-file
# Do that so that stable doesn't have the same git sha as the stable branch, so ReadTheDocs triggers a build
git commit -a -m "Add .dummy-file"
git tag -f stable
git push -f origin stable

0 comments on commit 25ee5a5

Please sign in to comment.