Skip to content

Commit 31945ec

Browse files
committed
style: update style
1 parent 19d6642 commit 31945ec

2 files changed

Lines changed: 48 additions & 48 deletions

File tree

.github/workflows/update.yaml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/update.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# this workflow merges requests from Dependabot if tests are passing
2+
# ref https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions
3+
# and https://github.com/dependabot/fetch-metadata
4+
name: Auto-merge
5+
6+
# `pull_request_target` means this uses code in the base branch, not the PR.
7+
on: pull_request_target
8+
9+
# Dependabot PRs' tokens have read permissions by default and thus we must enable write permissions.
10+
permissions:
11+
checks: read
12+
contents: write
13+
pull-requests: write
14+
15+
jobs:
16+
dependencies:
17+
runs-on: ubuntu-latest
18+
if: github.event.pull_request.user.login == 'dependabot[bot]'
19+
20+
steps:
21+
- name: Fetch PR metadata
22+
id: metadata
23+
uses: dependabot/[email protected]
24+
with:
25+
github-token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Wait for PR CI
28+
# Don't merge updates to GitHub Actions versions automatically.
29+
# (Some repos may wish to limit by version range (major/minor/patch), or scope (dep vs dev-dep), too.)
30+
if: contains(steps.metadata.outputs.package-ecosystem, 'npm')
31+
uses: lewagon/[email protected]
32+
with:
33+
ref: ${{ github.event.pull_request.head.sha }}
34+
repo-token: ${{ secrets.GITHUB_TOKEN }}
35+
wait-interval: 30 # seconds
36+
running-workflow-name: dependencies # wait for all checks except this one
37+
allowed-conclusions: success,skipped,cancelled # all other checks must pass, being skipped or cancelled is not sufficient
38+
39+
- name: Auto-merge dependabot PRs
40+
# Don't merge updates to GitHub Actions versions automatically.
41+
# (Some repos may wish to limit by version range (major/minor/patch), or scope (dep vs dev-dep), too.)
42+
if: contains(steps.metadata.outputs.package-ecosystem, 'npm')
43+
env:
44+
PR_URL: ${{ github.event.pull_request.html_url }}
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
# The "auto" flag will only merge once all of the target branch's required checks
47+
# are met. Configure those in the "branch protection" settings for each repo.
48+
run: gh pr merge --auto --squash "$PR_URL"

0 commit comments

Comments
 (0)