Skip to content

Commit ddf763b

Browse files
authored
Merge pull request #1909 from rubocop/ci-fix-publish-workflow
CI: When publishing, create a new branch per tag
2 parents 06fd3a0 + e01ebef commit ddf763b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ jobs:
3333
run: |
3434
sed -i 's/version:.*$/version: ~/' docs/antora.yml
3535
if ! git diff --exit-code docs/antora.yml; then
36+
branch=switch-docs-version-$(git tag --points-at @)
3637
git config user.name "${GITHUB_ACTOR}"
3738
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
38-
git checkout -b switch-docs-version
39+
git checkout -b "$branch"
3940
git add docs/antora.yml
4041
git commit -m "Switch docs version back"
41-
git push -u origin switch-docs-version
42-
gh pr create --fill --head switch-docs-version
42+
git push -u origin "$branch"
43+
gh pr create --fill --head "$branch"
4344
fi

0 commit comments

Comments
 (0)