Skip to content

Commit

Permalink
Make the AutoRevision update PR against the tagged branch
Browse files Browse the repository at this point in the history
We need to update AutoRevision.txt in both the stable and master branches, so
try to do that automatically.
  • Loading branch information
lmoureaux committed Feb 12, 2023
1 parent 6894c9d commit 44591e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ COPYING text
*.h text diff=cpp
*.h.in text diff=cpp
*.py text diff=python
*.cmd text eol=crlf
*.cmd text
# eol=crlf
*.sh text eol=lf
*.yaml text
*.yml text
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,21 @@ jobs:
- run: git rev-parse --short=5 HEAD > cmake/AutoRevision.txt
- run: git describe --tags `git rev-list --tags --max-count=1` >> cmake/AutoRevision.txt
- run: cat cmake/AutoRevision.txt
- name: Find target branch
id: branch
# We're running on a tag so have no direct access to the branch. Find it.
# Strip the first 3 components (ref/remotes/username)
run: |
git diff
branch=$(git branch -r --contains HEAD --format '%(refname:strip=3)')
echo Target branch is $branch
echo branch=$branch >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
base: ${{ steps.branch.outputs.branch }}
commit-message: "Release update of AutoRevision.txt"
branch: "release/autorevision"
branch: "release/autorevision/{{ steps.branch.outputs.branch }}"
title: "Release update of AutoRevision.txt"
body: >
Automatic changes triggered by a new release.
Expand Down

0 comments on commit 44591e7

Please sign in to comment.