Skip to content

Commit 2454790

Browse files
committed
ci: standardize action versions, fix trivy pin, add dependabot auto-merge
- Standardize all actions/checkout to @v4 across all workflows - Fix trivy-action reference from @master to @v0.34.0 - Add dependabot-auto-merge.yml with patch/minor filtering
1 parent 4fb42f9 commit 2454790

4 files changed

Lines changed: 37 additions & 7 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Dependabot Auto-Merge
2+
3+
on: pull_request
4+
5+
permissions:
6+
contents: write
7+
pull-requests: write
8+
9+
jobs:
10+
auto-merge:
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@v2
17+
with:
18+
github-token: "${{ secrets.GITHUB_TOKEN }}"
19+
- name: Auto-approve patch and minor updates
20+
if: steps.metadata.outputs.update-type != 'version-update:semver-major'
21+
run: gh pr review --approve "$PR_URL"
22+
env:
23+
PR_URL: ${{ github.event.pull_request.html_url }}
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Auto-merge patch and minor updates
26+
if: steps.metadata.outputs.update-type != 'version-update:semver-major'
27+
run: gh pr merge --auto --squash "$PR_URL"
28+
env:
29+
PR_URL: ${{ github.event.pull_request.html_url }}
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v6
17+
uses: actions/checkout@v4
1818
with:
1919
ref: ${{ github.event.pull_request.head.ref }}
2020

.github/workflows/security.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
if: github.event_name == 'pull_request'
2121
steps:
22-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
22+
- uses: actions/checkout@v4
2323
with:
2424
fetch-depth: 0
2525

@@ -49,7 +49,7 @@ jobs:
4949
runs-on: ubuntu-latest
5050
if: github.event_name == 'pull_request'
5151
steps:
52-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
52+
- uses: actions/checkout@v4
5353

5454
- name: Dependency Review
5555
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
@@ -58,7 +58,7 @@ jobs:
5858
trivy:
5959
runs-on: ubuntu-latest
6060
steps:
61-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
61+
- uses: actions/checkout@v4
6262

6363
- name: Run Trivy vulnerability scanner (IaC)
6464
uses: aquasecurity/trivy-action@c1824fd6edce30d7ab345a9989de00bbd46ef284 # v0.34.0

.github/workflows/validate.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@v6
31+
uses: actions/checkout@v4
3232

3333
- name: Setup Terraform
3434
uses: hashicorp/setup-terraform@v3
@@ -62,10 +62,10 @@ jobs:
6262

6363
steps:
6464
- name: Checkout
65-
uses: actions/checkout@v6
65+
uses: actions/checkout@v4
6666

6767
- name: Run Trivy security scanner
68-
uses: aquasecurity/trivy-action@c1824fd6edce30d7ab345a9989de00bbd46ef284 # master
68+
uses: aquasecurity/trivy-action@v0.34.0
6969
with:
7070
scan-type: config
7171
scan-ref: .

0 commit comments

Comments
 (0)