Skip to content

Commit af2e6d0

Browse files
authored
ci: auto-merge Dependabot minor and patch updates, allow the CodeQL neutral check (#525)
* ci: auto-merge Dependabot minor and patch updates, allow the CodeQL neutral check CodeQL default setup does not scan Dependabot PRs, so its check ends neutral and the gate failed on every Dependabot PR. Major updates are no longer merged automatically. * ci: say that GitHub Actions updates stay manual
1 parent b9791e5 commit af2e6d0

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

‎.github/workflows/update.yml‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,25 @@ jobs:
2424
github-token: ${{ secrets.GITHUB_TOKEN }}
2525

2626
- name: Wait for PR CI
27-
# Don't merge updates to GitHub Actions versions automatically.
28-
# (Some repos may wish to limit by version range (major/minor/patch), or scope (dep vs dev-dep), too.)
29-
if: contains(steps.metadata.outputs.package-ecosystem, 'npm')
27+
# npm minor and patch only (GitHub Actions updates stay manual); update-type is the highest update of a group, and empty when unknown
28+
if: >-
29+
contains(steps.metadata.outputs.package-ecosystem, 'npm') &&
30+
contains(fromJSON('["version-update:semver-minor","version-update:semver-patch"]'), steps.metadata.outputs.update-type)
3031
uses: lewagon/wait-on-check-action@369769072fe522a3a8a85c03c96af1e5242a1994 # v1.9.1
3132
with:
3233
ref: ${{ github.event.pull_request.head.sha }}
3334
repo-token: ${{ secrets.GITHUB_TOKEN }}
3435
wait-interval: 30 # seconds
3536
running-workflow-name: dependencies # wait for all checks except this one
36-
allowed-conclusions: success # all other checks must pass, being skipped or cancelled is not sufficient
37+
# CodeQL default setup does not scan Dependabot PRs, so its PR check ends neutral; an alert still ends as failure.
38+
# Skipped or cancelled is not sufficient.
39+
allowed-conclusions: success,neutral
3740

3841
- name: Auto-merge dependabot PRs
39-
# Don't merge updates to GitHub Actions versions automatically.
40-
# (Some repos may wish to limit by version range (major/minor/patch), or scope (dep vs dev-dep), too.)
41-
if: contains(steps.metadata.outputs.package-ecosystem, 'npm')
42+
# npm minor and patch only (GitHub Actions updates stay manual); update-type is the highest update of a group, and empty when unknown
43+
if: >-
44+
contains(steps.metadata.outputs.package-ecosystem, 'npm') &&
45+
contains(fromJSON('["version-update:semver-minor","version-update:semver-patch"]'), steps.metadata.outputs.update-type)
4246
env:
4347
PR_URL: ${{ github.event.pull_request.html_url }}
4448
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)