hrvey / combine-prs-workflow Goto Github PK
View Code? Open in Web Editor NEWCombine/group together PRs (for example from Dependabot and similar services)
Home Page: https://www.hrvey.com/blog/combine-dependabot-prs
License: MIT License
Combine/group together PRs (for example from Dependabot and similar services)
Home Page: https://www.hrvey.com/blog/combine-dependabot-prs
License: MIT License
What permissions are required for the script to work? I assumed pull-requests: write
should be enough, but I am getting
Error: Unhandled error: HttpError: Not Found
When script is requesting /pulls
endpoint, which looks like permission issue to me.
Dependabot finally added grouped updates, so this workflow is no longer needed ๐
https://github.blog/2023-08-24-a-faster-way-to-manage-version-updates-with-dependabot/
I love the idea of this, however I receive the following error:
ERROR: content conflict in site/composer.lock
fatal: merge program failed
Automated merge did not work.
Should not be doing an octopus.
Merge with strategy octopus failed.
Error: Process completed with exit code 2.
I'm using it with dependabot
PRs, status set to false
on the combine-prs-branch
branch.
Frequently when I merge multiple dependabot PRs in a row, I have to wait for subsequent PRs to rebase before I can proceed with the next. I'm thinking that's somehow related.
Here's the full output:
Run echo ""dependabot/composer/site/wpackagist-plugin/jetpack-9.0.1 dependabot/composer/site/satispress/woocommerce-subscriptions-3.0.9 dependabot/composer/site/wpackagist-plugin/woo-discount-rules-2.2.2 dependabot/composer/site/wpackagist-plugin/woocommerce-delivery-notes-4.6.0 dependabot/composer/site/wpackagist-plugin/event-tickets-5.0.1 dependabot/composer/site/wpackagist-plugin/user-switching-1.5.6 dependabot/composer/site/wpackagist-plugin/duplicate-post-3.2.6 dependabot/composer/site/wpackagist-plugin/wp-mail-smtp-2.4.0 dependabot/composer/site/wpackagist-plugin/woocommerce-services-1.24.3 dependabot/composer/site/wpackagist-plugin/woocommerce-4.5.2""
echo ""dependabot/composer/site/wpackagist-plugin/jetpack-9.0.1 dependabot/composer/site/satispress/woocommerce-subscriptions-3.0.9 dependabot/composer/site/wpackagist-plugin/woo-discount-rules-2.2.2 dependabot/composer/site/wpackagist-plugin/woocommerce-delivery-notes-4.6.0 dependabot/composer/site/wpackagist-plugin/event-tickets-5.0.1 dependabot/composer/site/wpackagist-plugin/user-switching-1.5.6 dependabot/composer/site/wpackagist-plugin/duplicate-post-3.2.6 dependabot/composer/site/wpackagist-plugin/wp-mail-smtp-2.4.0 dependabot/composer/site/wpackagist-plugin/woocommerce-services-1.24.3 dependabot/composer/site/wpackagist-plugin/woocommerce-4.5.2""
sourcebranches="${BRANCHES_TO_COMBINE%\"}"
sourcebranches="${sourcebranches#\"}"
basebranch="${BASE_BRANCH%\"}"
basebranch="${basebranch#\"}"
git config pull.rebase false
git config user.name github-actions
git config user.email [email protected]
git branch $COMBINE_BRANCH_NAME $basebranch
git checkout $COMBINE_BRANCH_NAME
git pull origin $sourcebranches --no-edit
git push origin $COMBINE_BRANCH_NAME
shell: /bin/bash -e {0}
env:
BASE_BRANCH: master
BRANCHES_TO_COMBINE: "dependabot/composer/site/wpackagist-plugin/jetpack-9.0.1 dependabot/composer/site/satispress/woocommerce-subscriptions-3.0.9 dependabot/composer/site/wpackagist-plugin/woo-discount-rules-2.2.2 dependabot/composer/site/wpackagist-plugin/woocommerce-delivery-notes-4.6.0 dependabot/composer/site/wpackagist-plugin/event-tickets-5.0.1 dependabot/composer/site/wpackagist-plugin/user-switching-1.5.6 dependabot/composer/site/wpackagist-plugin/duplicate-post-3.2.6 dependabot/composer/site/wpackagist-plugin/wp-mail-smtp-2.4.0 dependabot/composer/site/wpackagist-plugin/woocommerce-services-1.24.3 dependabot/composer/site/wpackagist-plugin/woocommerce-4.5.2"
COMBINE_BRANCH_NAME: combine-prs-branch
dependabot/composer/site/wpackagist-plugin/jetpack-9.0.1 dependabot/composer/site/satispress/woocommerce-subscriptions-3.0.9 dependabot/composer/site/wpackagist-plugin/woo-discount-rules-2.2.2 dependabot/composer/site/wpackagist-plugin/woocommerce-delivery-notes-4.6.0 dependabot/composer/site/wpackagist-plugin/event-tickets-5.0.1 dependabot/composer/site/wpackagist-plugin/user-switching-1.5.6 dependabot/composer/site/wpackagist-plugin/duplicate-post-3.2.6 dependabot/composer/site/wpackagist-plugin/wp-mail-smtp-2.4.0 dependabot/composer/site/wpackagist-plugin/woocommerce-services-1.24.3 dependabot/composer/site/wpackagist-plugin/woocommerce-4.5.2
Switched to branch 'combine-prs-branch'
From https://github.com/Scout-Branding/skin-wellness
* branch dependabot/composer/site/wpackagist-plugin/jetpack-9.0.1 -> FETCH_HEAD
* branch dependabot/composer/site/satispress/woocommerce-subscriptions-3.0.9 -> FETCH_HEAD
* branch dependabot/composer/site/wpackagist-plugin/woo-discount-rules-2.2.2 -> FETCH_HEAD
* branch dependabot/composer/site/wpackagist-plugin/woocommerce-delivery-notes-4.6.0 -> FETCH_HEAD
* branch dependabot/composer/site/wpackagist-plugin/event-tickets-5.0.1 -> FETCH_HEAD
* branch dependabot/composer/site/wpackagist-plugin/user-switching-1.5.6 -> FETCH_HEAD
* branch dependabot/composer/site/wpackagist-plugin/duplicate-post-3.2.6 -> FETCH_HEAD
* branch dependabot/composer/site/wpackagist-plugin/wp-mail-smtp-2.4.0 -> FETCH_HEAD
* branch dependabot/composer/site/wpackagist-plugin/woocommerce-services-1.24.3 -> FETCH_HEAD
* branch dependabot/composer/site/wpackagist-plugin/woocommerce-4.5.2 -> FETCH_HEAD
Trying simple merge with d228188c452f1d22f90e1dd0c088bdafa94d849c
Trying simple merge with 3f21d20663f628ccdf1bc2bcc15ed5319ddd430f
Simple merge did not work, trying automatic merge.
Auto-merging site/composer.lock
ERROR: content conflict in site/composer.lock
fatal: merge program failed
Automated merge did not work.
Should not be doing an octopus.
Merge with strategy octopus failed.
Error: Process completed with exit code 2.
Hi,
Thanks a lot for this action, and how it wonderfully deals with conflicts in package-lock.json.
I have actions and packages which are released at every commit to main. Meaning that for every dependabot pull request, or for a combined pull request created by your action, I also need to bump my own version to make releasing possible.
It would be magnificent if your action had an optional parameter to enable automatically bumping the patch number of the package.json version field.
Yowhattup. This workflow is great, solves my problem perfectly, but I am concerned that the MIT license includes the following:
blah blah subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
So to avoid violating, I have to have that license file in my repo for this specific bit of code. That's fine, but in that case, I think it'd be good to put the license info in the actual workflow file so folks acting in good faith, following the readme's instructions to copy the workflow into their repo, don't find themselves violating your copywrite.
That or change the license to one without that restriction.
Thanks for the great work.
When combining the dependabot PRs, keep getting merge conflicts, and the workflow is only able to pick one PR... I've observed this on many projects. However when updating library dependencies, the workflow works fine. So I'm getting this issue only on dependabot PRs.
I've added some logging, log for another run below
Run actions/github-script@v6
Pull for branch: update/sbt-wartremover-3.0.14
Pull for branch: update/scalafmt-core-3.7.3
Pull for branch: dependabot/github_actions/actions/setup-java-3.11.0
Branch matched prefix: dependabot/github_actions/actions/setup-java-3.11.0
Checking green status: dependabot/github_actions/actions/setup-java-3.11.0
Validating status: SUCCESS
Checking labels: dependabot/github_actions/actions/setup-java-3.11.0
Checking label: dependencies
Adding branch to array: dependabot/github_actions/actions/setup-java-3.11.0
Pull for branch: dependabot/github_actions/actions/checkout-3.5.0
Branch matched prefix: dependabot/github_actions/actions/checkout-3.5.0
Checking green status: dependabot/github_actions/actions/checkout-3.5.0
Validating status: SUCCESS
Checking labels: dependabot/github_actions/actions/checkout-3.5.0
Checking label: dependencies
Adding branch to array: dependabot/github_actions/actions/checkout-3.5.0
Pull for branch: update/sbt-wartremover-3.0.13
Pull for branch: update/mockito-scala-1.17.14
Pull for branch: update/logback-classic-1.4.6
Merged branch dependabot/github_actions/actions/setup-java-3.11.0
Failed to merge branch dependabot/github_actions/actions/checkout-3.5.0
ERROR: HttpError: refusing to allow a GitHub App to create or update workflow `.github/workflows/pull-request.yml` without `workflows` permission
Creating combined PR
Hey! Thanks for the workflow, first of all. I integrated it into https://github.com/SpoonLabs/sorald/ and it worked quite well. However, I had to fix the checking of CI status for each PR in the workflow. The URL here kept returning pending
even though I am sure the CI was completed with exit code 0. This has also been reported on GitHub community forum.
Firstly, thanks for the heads up at https://github.com/wbstack/ui/issues/190
I wonder if we should look at reworking this workflow into a single action?
This way folks might find it easier to get updates like this when needed?
Just tried using your amazing Action for the first time, I copied the .yml
file into my own project, pushed, and executed it from the Actions menu, as demonstrated in the README. However, I get an error (state
is null), and when I inspect the code I can confirm that state
is being passed into something before it is defined.
Here's the error I experienced if you'd like to see for yourself:
https://github.com/paperize/docs/actions/runs/3152233066/jobs/5127186452
I stepped back to the version of the yml file from 17 days ago, and it almost worked, except that all of my PRs were returning a pending
status. I loosened up the status check to just be "not failed
", and got the whole thing working.
You've saved me so much time, thank you! Let me know if I can be of further assistance troubleshooting this bug.
Is it possible to do only one push for all commits ?
Because for now it's one push per commit and each push triggers a build on CI infrastructure.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.