Skip to content

Commit 13de693

Browse files
authored
Merge pull request #2527 from ViewComponent/dependabot-automerge
Streamline dependabot workflow
2 parents 9ac3187 + 9a3e00e commit 13de693

File tree

5 files changed

+38
-4
lines changed

5 files changed

+38
-4
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ updates:
33
- package-ecosystem: "bundler"
44
directory: "/"
55
schedule:
6-
interval: "weekly"
6+
interval: "daily"
77
- package-ecosystem: "bundler"
88
directory: "/docs"
99
schedule:
10-
interval: "weekly"
10+
interval: "daily"
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:
4+
pull_request:
5+
types: [opened]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
dependabot:
13+
runs-on: ubuntu-latest
14+
if: github.actor == 'dependabot[bot]'
15+
steps:
16+
- name: Approve Dependabot PR
17+
run: gh pr review --approve "$PR_URL"
18+
env:
19+
PR_URL: ${{github.event.pull_request.html_url}}
20+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
21+
- name: Enable auto-merge for Dependabot PRs
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}}

.github/workflows/lint.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ jobs:
6262
steps:
6363
- name: echo changed files
6464
run: |
65-
if [[ ! "${{needs.changedfiles.outputs.markdown}}" == *"CHANGELOG.md"* ]]; then
65+
# Filter out Gemfile.lock files from changed files
66+
ALL_FILES="${{needs.changedfiles.outputs.all}}"
67+
FILTERED_FILES=$(echo "$ALL_FILES" | tr ' ' '\n' | grep -v '^Gemfile\.lock$' | grep -v '^docs/Gemfile\.lock$' | tr '\n' ' ' | xargs)
68+
69+
# Only require changelog if there are other files changed
70+
if [[ -n "$FILTERED_FILES" ]] && [[ ! "${{needs.changedfiles.outputs.markdown}}" == *"CHANGELOG.md"* ]]; then
6671
echo "::error file=CHANGELOG.md,line=1,col=1::Please make sure that you add a docs/CHANGELOG.md entry to describe the changes in this pull request."
6772
exit 1
6873
fi

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ nav_order: 6
1010

1111
## main
1212

13+
* Automatically merge dependabot PRs.
14+
15+
*Joel Hawksley*
16+
1317
* Use Ruby 4.0.0 in CI and dev.
1418

1519
*Joel Hawksley*

test/sandbox/test/rendering_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_render_inline_allocations
2020
MyComponent.__vc_ensure_compiled
2121

2222
with_instrumentation_enabled_option(false) do
23-
assert_allocations({"4.1" => 67, "4.0" => 67, "3.4" => 72..74, "3.3" => 75, "3.2" => 78..79}) do
23+
assert_allocations({"4.1" => 67..68, "4.0" => 67, "3.4" => 72..74, "3.3" => 75, "3.2" => 78..79}) do
2424
render_inline(MyComponent.new)
2525
end
2626
end

0 commit comments

Comments
 (0)