Skip to content

Commit 2312260

Browse files
committed
Update release tag workflow to support 1.x and 2.x
1 parent 36c5765 commit 2312260

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/create_release_tag_and_pr.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ jobs:
2121
distribution: 'temurin'
2222
cache: 'maven'
2323

24-
- name: Reset staging/main
24+
- name: Reset staging
2525
id: staging
2626
run: |
27-
git checkout -B staging/main
28-
git push --set-upstream -f origin staging/main
27+
git checkout -B staging/$GITHUB_REF_NAME
28+
git push --set-upstream -f origin staging/$GITHUB_REF_NAME
29+
env:
30+
GITHUB_REF_NAME: ${{ github.ref_name }}
2931

3032
- name: Set Release Version
3133
id: release
@@ -37,7 +39,7 @@ jobs:
3739
with:
3840
commit_message: "Prepare release (${{ github.actor }}): github-api-${{ steps.release.outputs.version }}"
3941
tagging_message: 'github-api-${{ steps.release.outputs.version }}'
40-
branch: staging/main
42+
branch: staging/${{ github.ref_name }}
4143

4244
- name: Increment Snapshot Version
4345
run: |
@@ -46,12 +48,12 @@ jobs:
4648
- uses: stefanzweifel/git-auto-commit-action@v5
4749
with:
4850
commit_message: "Prepare for next development iteration"
49-
branch: staging/main
51+
branch: staging/${{ github.ref_name }}
5052

51-
- name: pull-request to main
53+
- name: Create pull-request
5254
uses: repo-sync/pull-request@v2
5355
with:
5456
pr_title: "Prepare release (${{ github.actor }}): github-api-${{ steps.release.outputs.version }}"
55-
source_branch: "staging/main"
56-
destination_branch: "main"
57+
source_branch: "staging/${{ github.ref_name }}"
58+
destination_branch: "${{ github.ref_name }}"
5759
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)