Skip to content

Commit b4b1337

Browse files
committed
chore: align gh actions and dependabot with ecosystem standard
1 parent 9098c90 commit b4b1337

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ updates:
1515
package-ecosystem: "github-actions"
1616
schedule:
1717
interval: "daily"
18+
groups:
19+
security-updates:
20+
patterns:
21+
- '*'
22+
exclude-patterns:
23+
- 'storyblok*'
24+
update-types:
25+
- patch
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Dependabot auto-approve
2+
on: pull_request
3+
4+
permissions:
5+
pull-requests: write
6+
7+
jobs:
8+
dependabot:
9+
runs-on: ubuntu-latest
10+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'storyblok/php-content-api-client'
11+
steps:
12+
- name: Dependabot metadata
13+
id: metadata
14+
uses: dependabot/fetch-metadata@v2
15+
with:
16+
github-token: "${{ secrets.GITHUB_TOKEN }}"
17+
alert-lookup: true
18+
- uses: actions/checkout@v4
19+
- name: Approve a PR if not already approved
20+
run: |
21+
gh pr checkout "$PR_URL" # sets the upstream metadata for `gh pr status`
22+
if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ];
23+
then gh pr review --approve "$PR_URL"
24+
else echo "PR already approved, skipping additional approvals to minimize emails/notification noise.";
25+
fi
26+
env:
27+
PR_URL: ${{github.event.pull_request.html_url}}
28+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)