Skip to content

Commit

Permalink
Update version pull req (#1024)
Browse files Browse the repository at this point in the history
  • Loading branch information
umbertoDifa authored Feb 28, 2025
1 parent f3e7a0a commit 1bae943
Showing 1 changed file with 29 additions and 16 deletions.
45 changes: 29 additions & 16 deletions .github/workflows/version_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,39 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create pull request to master
- name: Create pull request to master and auto-merge
if: ${{ env.TEST_MODE != 'true' }}
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: master
branch: ${{ env.BRANCH_NAME }}
title: "Version bump to ${{ env.TAG_PREFIX}}${{ env.NEW_VERSION }}"
body: |
This PR contains version bump changes for release ${{ env.TAG_PREFIX}}${{ env.NEW_VERSION }}.
run: |
# Install GitHub CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
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
sudo apt update
sudo apt install gh
# Authenticate GitHub CLI
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
# Create PR
gh pr create \
--base master \
--head ${{ env.BRANCH_NAME }} \
--title "Version bump to ${{ env.TAG_PREFIX}}${{ env.NEW_VERSION }}" \
--body "This PR contains version bump changes for release ${{ env.TAG_PREFIX}}${{ env.NEW_VERSION }}.
Changes:
- Updated version in pyproject.toml
- Updated version in darwin/__init__.py
This PR was automatically created by the version bump workflow.
labels: |
automated-pr
version-bump
draft: false
- Updated version in darwin/version/__init__.py
This PR was automatically created by the version bump workflow." \
--label "automated-pr,version-bump"
# Get PR number
PR_NUMBER=$(gh pr list --head ${{ env.BRANCH_NAME }} --json number -q '.[0].number')
# Enable auto-merge
gh pr merge $PR_NUMBER --auto --merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create and push tag
run: |
Expand Down

0 comments on commit 1bae943

Please sign in to comment.