Skip to content

Commit b4b8656

Browse files
committed
ci: dependabot version updates + auto-merge parity
Brings pgraph-python in line with RTB/MVTB/bdsim: a dependabot.yml (github-actions ecosystem), an auto-merge workflow for patch/minor bumps, and an all-tests-passed gate job branch protection can require.
1 parent c133638 commit b4b8656

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
labels:
8+
- "dependencies"

‎.github/workflows/ci.yml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ jobs:
4848
continue-on-error: true
4949
run: mypy src/pgraph/PGraph.py
5050

51+
all-tests-passed:
52+
name: All tests passed
53+
needs: unittest
54+
runs-on: ubuntu-latest
55+
if: always()
56+
steps:
57+
- name: Check test matrix result
58+
run: |
59+
if [ "${{ needs.unittest.result }}" != "success" ]; then
60+
echo "test matrix did not succeed: ${{ needs.unittest.result }}"
61+
exit 1
62+
fi
63+
5164
codecov:
5265
needs: unittest
5366
runs-on: ubuntu-latest
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Dependabot auto-merge
2+
3+
on: pull_request
4+
5+
permissions:
6+
contents: write
7+
pull-requests: write
8+
9+
jobs:
10+
dependabot:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.actor == 'dependabot[bot]' }}
13+
steps:
14+
- name: Dependabot metadata
15+
id: metadata
16+
uses: dependabot/fetch-metadata@v3
17+
with:
18+
github-token: "${{ secrets.GITHUB_TOKEN }}"
19+
20+
- name: Enable auto-merge for patch/minor bumps
21+
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' }}
22+
run: gh pr merge --auto --merge "$PR_URL"
23+
env:
24+
PR_URL: ${{ github.event.pull_request.html_url }}
25+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)