Skip to content

Commit 579e479

Browse files
Update GitHub Actions workflows and configurations for improved dependency management and auto-merge functionality (#3)
1 parent adf6f0a commit 579e479

File tree

5 files changed

+72
-3
lines changed

5 files changed

+72
-3
lines changed

.github/dependabot.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
target-branch: "master"
6+
schedule:
7+
interval: "weekly"
8+
day: "sunday"
9+
labels:
10+
- "auto update"
11+
- "infrastructure"
12+
- "no RN"
13+
open-pull-requests-limit: 3
14+
commit-message:
15+
prefix: "chore"
16+
include: "scope"
17+
18+
- package-ecosystem: "pip"
19+
directory: "/"
20+
target-branch: "master"
21+
schedule:
22+
interval: "weekly"
23+
day: "sunday"
24+
labels:
25+
- "auto update"
26+
- "infrastructure"
27+
- "no RN"
28+
open-pull-requests-limit: 3
29+
commit-message:
30+
prefix: "chore"
31+
include: "scope"
32+
allow:
33+
- dependency-type: "direct"

.github/workflows/dependabot.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# NOTE: This workflow expects that branch protection rules require all checks to pass before merging.
2+
# Auto-merge will only occur if all required status checks and reviews are successful.
3+
4+
name: Dependabot auto-approve and auto-merge
5+
on:
6+
pull_request:
7+
types: [opened, synchronize]
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
dependabot:
15+
name: Auto-approve and auto-merge Dependabot PRs
16+
runs-on: ubuntu-latest
17+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'AbsaOSS/GH-automation'
18+
steps:
19+
- name: Dependabot metadata
20+
id: metadata
21+
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b
22+
with:
23+
github-token: "${{ secrets.GITHUB_TOKEN }}"
24+
- name: Approve a PR
25+
run: gh pr review --approve "$PR_URL"
26+
env:
27+
PR_URL: ${{ github.event.pull_request.html_url }}
28+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
- name: Enable auto-merge for Dependabot PRs
30+
if: startsWith(steps.metadata.outputs.update-type, 'version-update') || startsWith(steps.metadata.outputs.update-type, 'security')
31+
run: gh pr merge --auto --squash "$PR_URL"
32+
continue-on-error: true
33+
env:
34+
PR_URL: ${{ github.event.pull_request.html_url }}
35+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/dependent_items.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
name: Dependent Items Check
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: z0al/dependent-issues@v1.5.2
31+
- uses: z0al/dependent-issues@950226e7ca8fc43dc209a7febf67c655af3bdb43
3232
env:
3333
# (Required) The token to use to make API calls to GitHub.
3434
GITHUB_TOKEN: ${{ secrets.PAT_REPO_PROJECT_DISCUSS }}

.github/workflows/release-notes-presence-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131
runs-on: ubuntu-latest
3232

3333
steps:
34-
- uses: actions/setup-python@v5.1.1
34+
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
3535
with:
3636
python-version: '3.11'
3737

3838
- name: Check presence of release notes in PR description
39-
uses: AbsaOSS/release-notes-presence-check@v0.2.1
39+
uses: AbsaOSS/release-notes-presence-check@8e586b26a5e27f899ee8590a5d988fd4780a3dbf
4040
env:
4141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4242
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ build.log
4848
.bsp
4949
/.bloop/
5050
/.metals/
51+
.github/workflows/.DS_Store

0 commit comments

Comments
 (0)