-
-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (61 loc) · 1.88 KB
/
update-dist.yaml
File metadata and controls
75 lines (61 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Dependabot PR
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- dependabot/**
jobs:
update-dist:
name: Update dist
runs-on: ubuntu-22.04
if: >
startsWith(github.head_ref, 'dependabot/npm_and_pnpm') &&
github.actor == 'dependabot[bot]'
permissions:
contents: write
steps:
- name: Check out code
uses: actions/checkout@v6.0.2
with:
ref: ${{ github.head_ref }}
- name: Setup Node
uses: actions/setup-node@v6.2.0
with:
node-version: '20'
- name: Setup pnpm
run: npm install --location=global pnpm
- name: Install dependencies
run: pnpm install
- name: Update dist
run: pnpm build
- name: Commit new dist
uses: stefanzweifel/git-auto-commit-action@v7
with:
file_pattern: dist
commit_message: Build dist
auto-approve-pr:
name: Update dist
runs-on: ubuntu-22.04
if: >
startsWith(github.head_ref, 'dependabot/npm_and_pnpm') &&
github.actor == 'dependabot[bot]'
needs: [update-dist]
permissions:
pull-requests: write
steps:
- name: Check out code
uses: actions/checkout@v6.0.2
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2.5.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve a PR
if: ${{ steps.dependabot-metadata.outputs.update-type == "version-update:semver-patch" }}
run: |
gh pr checkout "$PR_URL"
[ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ] \
&& gh pr review --approve "$PR_URL" -b "LGTM :rocket:"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}