diff --git a/README.md b/README.md index 9363e03..a02b125 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,9 @@ Then on GitHub, click the 'Actions' tab at the top of your repository, then unde # Customization The workflow uses only the [actions/github-script](https://github.com/actions/github-script/) and [actions/checkout](https://github.com/actions/checkout/) actions published by GitHub. -As you can see from the image you can easily set another branch prefix for matching, and choose whether to only include branches that are green (have the 'success' status on GitHub, e.g. from successful CI) - this is the default. -If you don't run checks, then set this setting to false, since a PR with no checks will have a status of 'pending' rather than 'success'. +As you can see from the image you can easily set another branch prefix for matching, and choose whether to only include branches that are green (have the 'success' status on GitHub, e.g. from successful CI) - this is the default. If you don't run checks, then set this setting to false, since a PR with no checks will have a status of 'pending' rather than 'success'. + +Finally, you can set a label on PRs that you want to exclude when combining PRs - by default this label is 'nocombine'. For example this can be handy if you have a single PR causing merge conflicts (see Limitations below). In that case you can exclude that PR by adding the label, and still combine the rest of the PRs. You are also welcome to modify the code to your needs if you need more customization than that (for example it currently doesn't work with forks, only branches within the same repo). @@ -23,3 +24,5 @@ This typically happens if they share some common third dependency - for example The "correct" solution here is to add both dependencies together, then let the package manager resolve the dependencies to hopefully find a version of C to put in the `.lock` file that will satisfy both A and B. If you find yourself in need of this, then this workflow won't help you, and you should consider switching to a dependency update service that will update dependencies together like that (at the moment *Dependabot* does not, but *Depfu* and *Renovate* do). + +If it's only a single PR out of several that is causing merge issues, you can use the label 'nocombine' (see above) to merge the others together, then merge the last one alone. diff --git a/combine-prs.yml b/combine-prs.yml index fb8e44e..0e65b80 100644 --- a/combine-prs.yml +++ b/combine-prs.yml @@ -16,6 +16,10 @@ on: description: 'Name of the branch to combine PRs into' required: true default: 'combine-prs-branch' + ignoreLabel: + description: 'Exclude PRs with this label' + required: true + default: 'nocombine' # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -61,6 +65,16 @@ jobs: } } } + console.log('Checking labels: ' + branch); + const labels = pull['labels']; + for(const label of labels) { + const labelName = label['name']; + console.log('Checking label: ' + labelName); + if(labelName == '${{ github.event.inputs.ignoreLabel }}') { + console.log('Discarding ' + branch + ' with label ' + labelName); + statusOK = false; + } + } if (statusOK) { console.log('Adding branch to array: ' + branch); branches.push(branch); diff --git a/images/run.png b/images/run.png index 7845dc9..a69a95f 100644 Binary files a/images/run.png and b/images/run.png differ