-
Notifications
You must be signed in to change notification settings - Fork 284
63 lines (53 loc) · 1.57 KB
/
label-actions.yml
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
name: "Label Actions"
# env:
# GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
on:
pull_request_target:
types: [labeled, unlabeled]
# issues:
# types: [labeled, unlabeled]
# discussion:
# types: [labeled, unlabeled]
permissions:
contents: read
issues: write
pull-requests: write
discussions: write
jobs:
# run the local prettier config on the PR
prettier:
if: contains(github.event.pull_request.labels.*.name, 'prettier')
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js node
uses: actions/setup-node@v2
with:
node-version: "18"
- name: before_install
run:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
&& sudo sysctl -p
# perform steps to modify as desired
- name: yarn install
run: yarn install
- name: yarn prettier:fix
run: yarn prettier:fix
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: prettier"
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/label-actions@v4
with:
# github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
config-path: ".github/label-actions.yml"