Skip to content

Commit 1bae943

Browse files
authored
Update version pull req (#1024)
1 parent f3e7a0a commit 1bae943

File tree

1 file changed

+29
-16
lines changed

1 file changed

+29
-16
lines changed

.github/workflows/version_bump.yml

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -119,26 +119,39 @@ jobs:
119119
env:
120120
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121121

122-
- name: Create pull request to master
122+
- name: Create pull request to master and auto-merge
123123
if: ${{ env.TEST_MODE != 'true' }}
124-
uses: peter-evans/create-pull-request@v7
125-
with:
126-
token: ${{ secrets.GITHUB_TOKEN }}
127-
base: master
128-
branch: ${{ env.BRANCH_NAME }}
129-
title: "Version bump to ${{ env.TAG_PREFIX}}${{ env.NEW_VERSION }}"
130-
body: |
131-
This PR contains version bump changes for release ${{ env.TAG_PREFIX}}${{ env.NEW_VERSION }}.
124+
run: |
125+
# Install GitHub CLI
126+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
127+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
128+
sudo apt update
129+
sudo apt install gh
130+
131+
# Authenticate GitHub CLI
132+
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
133+
134+
# Create PR
135+
gh pr create \
136+
--base master \
137+
--head ${{ env.BRANCH_NAME }} \
138+
--title "Version bump to ${{ env.TAG_PREFIX}}${{ env.NEW_VERSION }}" \
139+
--body "This PR contains version bump changes for release ${{ env.TAG_PREFIX}}${{ env.NEW_VERSION }}.
132140
133141
Changes:
134142
- Updated version in pyproject.toml
135-
- Updated version in darwin/__init__.py
136-
137-
This PR was automatically created by the version bump workflow.
138-
labels: |
139-
automated-pr
140-
version-bump
141-
draft: false
143+
- Updated version in darwin/version/__init__.py
144+
145+
This PR was automatically created by the version bump workflow." \
146+
--label "automated-pr,version-bump"
147+
148+
# Get PR number
149+
PR_NUMBER=$(gh pr list --head ${{ env.BRANCH_NAME }} --json number -q '.[0].number')
150+
151+
# Enable auto-merge
152+
gh pr merge $PR_NUMBER --auto --merge
153+
env:
154+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142155

143156
- name: Create and push tag
144157
run: |

0 commit comments

Comments
 (0)