-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: add workflow to create a version bump PR (#44998)
the idea is to add a shortcut to "wait for dependabot to open a PR" such that developers can bump internal libraries more rapidly (I tried this out in a personal repo, seems to work well assuming the permissions are correct)
- Loading branch information
1 parent
982f363
commit 085c8ab
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
package: | ||
required: true | ||
type: string | ||
description: package name such as `sentry-arroyo` | ||
version: | ||
required: true | ||
type: string | ||
description: desired version such as `1.2.3` | ||
|
||
# disable all permissions -- we use the PAT's permissions instead | ||
permissions: {} | ||
|
||
jobs: | ||
bump-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 | ||
with: | ||
token: ${{ secrets.BUMP_SENTRY_TOKEN }} | ||
- run: | | ||
set -euxo pipefail | ||
git checkout -b "bot/bump-version/$PACKAGE/$VERSION" | ||
re="$(sed 's/[_-]/[_-]/g' <<< "$PACKAGE")" | ||
sed -i "s/^$re==.*/$PACKAGE==$VERSION/g" -- requirements*.txt | ||
git \ | ||
-c user.name=getsentry-bot \ | ||
-c user.email='[email protected]' \ | ||
commit \ | ||
--all \ | ||
--message "ref: bump $PACKAGE to $VERSION" \ | ||
--message "Co-Authored-By: $SENDER <[email protected]>" | ||
git push origin HEAD --quiet | ||
gh pr create --fill | ||
env: | ||
GH_TOKEN: ${{ secrets.BUMP_SENTRY_TOKEN }} | ||
PACKAGE: ${{ inputs.package }} | ||
VERSION: ${{ inputs.version }} | ||
SENDER: ${{ github.event.sender.login }} | ||
SENDER_ID: ${{ github.event.sender.id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters