-
Notifications
You must be signed in to change notification settings - Fork 10
97 lines (81 loc) · 2.79 KB
/
update-docs-etc.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Update docs etc
on:
pull_request:
types: [labeled]
jobs:
update:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
# Only if it contains a certain label.
if: "contains( github.event.pull_request.labels.*.name, 'eve: update docs etc')"
steps:
- name: Update labels
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN_EVE }}
script: |
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'eve: update docs etc',
});
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['[bot]: updating docs etc'],
});
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN_EVE }}
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- run: git checkout --track origin/${{ github.event.pull_request.head.ref }}
- run: |
git config --global user.name 'easyops-eve'
git config --global user.email '[email protected]'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: yarn
- name: Cache for nx (v3)
uses: actions/cache@v4
with:
path: .cache
key: ${{ runner.os }}-nx-v3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-nx-v3-
- run: yarn install --frozen-lockfile
- name: Build and update docs etc
run: |
npx lerna run build --scope @next-core/types || npx lerna run docs:dev --scope @next-core/types
npx lerna run build --scope @next-core/runtime || npx lerna run docs:dev --scope @next-core/runtime
env:
NX_REJECT_UNKNOWN_LOCAL_CACHE: '0'
- name: Git commit and push
run: |
git add -A
git commit -m "chore(): update docs etc"
git push
- name: Post update labels
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN_EVE }}
script: |
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: '[bot]: updating docs etc',
});
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['[bot]: updated docs etc'],
});