Skip to content

Commit bc0f7eb

Browse files
ci(deps): automerge updates to dependencies from the kind dependabot (#53)
Co-authored-by: slack-samples[bot] <169401055+slack-samples[bot]@users.noreply.github.com>
1 parent 929c31c commit bc0f7eb

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/dependencies.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Merge updates to dependencies
2+
on:
3+
pull_request:
4+
jobs:
5+
dependabot:
6+
name: "@dependabot"
7+
if: github.event.pull_request.user.login == 'dependabot[bot]'
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
steps:
13+
- name: Collect metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
16+
with:
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
- name: Approve
19+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
20+
run: gh pr review --approve "$PR_URL"
21+
env:
22+
PR_URL: ${{github.event.pull_request.html_url}}
23+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
24+
- name: Automerge
25+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
26+
run: gh pr merge --auto --squash "$PR_URL"
27+
env:
28+
PR_URL: ${{ github.event.pull_request.html_url }}
29+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)