Skip to content

Commit e723e10

Browse files
Update staging version bump workflow script
1 parent 1b9ef04 commit e723e10

1 file changed

Lines changed: 19 additions & 27 deletions

File tree

.github/workflows/staging-version-bump.yml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Bump Version
33
on:
44
push:
55
branches:
6+
- staging
67
- staging-release
78
- staging-release-*
89
workflow_dispatch:
@@ -24,7 +25,7 @@ jobs:
2425
with:
2526
fetch-depth: 0
2627
token: ${{ secrets.GITHUB_TOKEN }}
27-
ref: ${{ github.ref }} # pin to exact triggering ref, avoids implicit merge with master
28+
ref: ${{ github.ref }}
2829

2930
- name: Get current branch name
3031
id: branch
@@ -51,10 +52,10 @@ jobs:
5152
echo "Found version.properties:"
5253
cat version.properties
5354
54-
- name: Run bump_version.py
55+
- name: Run bump_versions.py
5556
id: bump
5657
run: |
57-
python bump_version.py \
58+
python bump_versions.py \
5859
"${{ steps.previoustag.outputs.tag }}" \
5960
"${{ steps.branch.outputs.name }}" \
6061
> /tmp/version_bumped.properties
@@ -67,32 +68,23 @@ jobs:
6768
run: |
6869
git config user.name "github-actions[bot]"
6970
git config user.email "github-actions[bot]@users.noreply.github.com"
70-
git status
71-
git log --oneline -5 # show last 5 commits so we can see history clearly
7271
git add version.properties
7372
git diff --cached --quiet || git commit -m "chore: bump version [skip ci]"
74-
git push origin HEAD:${{ steps.branch.outputs.name }} # explicit HEAD:branch avoids any detached state issues
73+
git push origin HEAD:${{ steps.branch.outputs.name }}
7574
7675
- name: Open PR to master
77-
uses: peter-evans/create-pull-request@v7
78-
with:
79-
token: ${{ secrets.GITHUB_TOKEN }}
80-
base: master
81-
branch: ${{ steps.branch.outputs.name }}
82-
title: "chore: bump version (${{ steps.previoustag.outputs.tag }} → ${{ steps.branch.outputs.name }})"
83-
body: |
84-
## Version Bump
85-
86-
Automated version bump triggered by push to `${{ steps.branch.outputs.name }}`.
87-
88-
| Field | Value |
89-
|--------------|-------|
90-
| Previous tag | `${{ steps.previoustag.outputs.tag }}` |
91-
| Branch | `${{ steps.branch.outputs.name }}` |
76+
env:
77+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
run: |
79+
gh pr create \
80+
--base master \
81+
--head "${{ steps.branch.outputs.name }}" \
82+
--title "chore: bump version (${{ steps.previoustag.outputs.tag }} → ${{ steps.branch.outputs.name }})" \
83+
--body "Automated version bump from \`${{ steps.branch.outputs.name }}\`
9284
93-
**`version.properties` contents:**
94-
```
95-
${{ steps.bump.outputs.result }}
96-
```
97-
labels: automated, version-bump
98-
draft: false
85+
**version.properties:**
86+
\`\`\`
87+
${{ steps.bump.outputs.result }}
88+
\`\`\`" \
89+
--label "automated" \
90+
|| echo "PR already exists, skipping"

0 commit comments

Comments
 (0)