Skip to content

Commit 21c2eaf

Browse files
Merge pull request #104 from technote-space/chore/chore-sync-workflows
chore: sync workflows
2 parents 48eba18 + 9882f4f commit 21c2eaf

File tree

10 files changed

+127
-77
lines changed

10 files changed

+127
-77
lines changed

.github/workflow-settings.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,18 @@
1313
"TOC_FOLDING": "1",
1414
"TOC_MAX_HEADER_LEVEL": "3",
1515
"TOC_TITLE": "Details",
16-
"BRANCH_PREFIX": "release/"
17-
}
16+
"TOC_CREATE_PR": "true",
17+
"TOC_TARGET_PATHS": "README*.md",
18+
"BRANCH_PREFIX": "release/",
19+
"ANNOTATION_EXCLUDE_PATTERNS": [
20+
">> warning ",
21+
">> hint: ",
22+
"Cloning into",
23+
"has unmet peer dependency",
24+
"has incorrect peer dependency",
25+
"Using version",
26+
"ci-helper",
27+
"tests/bootstrap.php"
28+
],
29+
"CHANGE_TEMPLATE": "- [ ] ${TITLE} (#${NUMBER}) @${AUTHOR}"
30+
}

.github/workflows/add-release-tag.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- develop/v*
77
types: [closed]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
912
name: Add release tag
1013

1114
jobs:
@@ -17,7 +20,8 @@ jobs:
1720
steps:
1821
- uses: technote-space/load-config-action@v1
1922
with:
20-
CONFIG_FILENAME: workflow-settings.json
23+
CONFIG_FILENAME: workflow-settings.json, workflow-details.json
24+
IGNORE_WARNING: 'true'
2125
- name: Get version
2226
uses: technote-space/get-next-version-action@v1
2327
with:
@@ -28,7 +32,7 @@ jobs:
2832
env:
2933
HEAD_REF: ${{ github.head_ref }}
3034
if: startsWith(github.head_ref, 'release/v')
31-
- uses: actions/github-script@0.4.0
35+
- uses: actions/github-script@v3
3236
with:
3337
github-token: ${{ secrets.ACCESS_TOKEN }}
3438
script: |
@@ -39,7 +43,7 @@ jobs:
3943
sha: context.sha
4044
})
4145
if: env.NEXT_VERSION
42-
- uses: actions/github-script@0.4.0
46+
- uses: actions/github-script@v3
4347
with:
4448
github-token: ${{ secrets.ACCESS_TOKEN }}
4549
script: |
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
on:
22
schedule:
3-
- cron: 27 3 4 * *
3+
- cron: 18 18 19 * *
44
repository_dispatch:
55
types: [check-link]
66
workflow_dispatch:
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
811
name: Broken Link Check
912
jobs:
1013
check:
1114
name: Broken Link Check
1215
runs-on: ubuntu-latest
1316
timeout-minutes: 10
1417
steps:
15-
- uses: technote-space/auto-cancel-redundant-workflow@v1
16-
with:
17-
EXCLUDE_MERGED: 'true'
1818
- name: Broken Link Check
1919
uses: technote-space/broken-link-checker-action@v2
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
on:
2+
workflow_run:
3+
workflows:
4+
- CI
5+
- Sync workflows
6+
- Update dependencies
7+
- Broken Link Check
8+
types:
9+
- completed
10+
11+
name: Check Warnings
12+
13+
jobs:
14+
annotations:
15+
name: Annotations
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 3
18+
steps:
19+
- uses: technote-space/load-config-action@v1
20+
with:
21+
CONFIG_FILENAME: workflow-settings.json, workflow-details.json
22+
IGNORE_WARNING: 'true'
23+
- uses: technote-space/download-annotations-action@v2
24+
id: annotations
25+
with:
26+
TARGET_RUN_ID: ${{ github.event.workflow_run.id }}
27+
INCLUDE_LEVELS: warning
28+
EXCLUDE_MESSAGE_PATTERNS: ${{ env.ANNOTATION_EXCLUDE_PATTERNS }}
29+
- name: Build attachments
30+
run: |
31+
arr1='[{"fields":[{"title":"repo","value":"<https://github.com/${{ github.repository }}|${{ github.repository }}>","short":true},{"title":"action","value":"<${{ github.event.workflow_run.html_url }}|summary>","short":true}]}]'
32+
arr2=$(echo '${{ steps.annotations.outputs.messages }}' | jq -c 'map({"color":"warning","text":"```\(.)```"})')
33+
echo "SLACK_ATTACHMENTS=$(jq --argjson arr1 "$arr1" --argjson arr2 "$arr2" -nc '$arr1 + $arr2')" >> $GITHUB_ENV
34+
if: steps.annotations.outputs.number > 0
35+
- uses: 8398a7/action-slack@v3
36+
with:
37+
status: custom
38+
fields: repo
39+
custom_payload: |
40+
{
41+
text: "Warning annotations",
42+
attachments: ${{ env.SLACK_ATTACHMENTS }}
43+
}
44+
env:
45+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
46+
if: steps.annotations.outputs.number > 0 && env.SLACK_WEBHOOK_URL

.github/workflows/ci.yml

Lines changed: 26 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
on: push
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
36
name: CI
47

58
jobs:
@@ -10,14 +13,11 @@ jobs:
1013
env:
1114
LINT: 1
1215
steps:
13-
- uses: technote-space/auto-cancel-redundant-workflow@v1
14-
with:
15-
EXCLUDE_MERGED: 'true'
1616
- name: Set running flag
1717
run: echo "RUNNING=1" >> $GITHUB_ENV
1818
- uses: actions/checkout@v2
1919
- uses: technote-space/get-git-comment-action@v1
20-
- uses: technote-space/get-diff-action@v4
20+
- uses: technote-space/get-diff-action@v5
2121
with:
2222
PATTERNS: +(src|__tests__)/**/*.+(js|ts)
2323
FILES: |
@@ -28,17 +28,10 @@ jobs:
2828
run: echo "RUNNING=" >> $GITHUB_ENV
2929
if: "! env.GIT_DIFF"
3030

31-
- name: Get Yarn Cache Directory
32-
id: yarn-cache
33-
run: echo "::set-output name=dir::$(yarn cache dir)"
34-
if: env.RUNNING
35-
- name: Cache node dependencies
36-
uses: actions/cache@v2
31+
- uses: actions/setup-node@v2
3732
with:
38-
path: ${{ steps.yarn-cache.outputs.dir }}
39-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
40-
restore-keys: |
41-
${{ runner.os }}-yarn-
33+
node-version: 14
34+
cache: yarn
4235
if: env.RUNNING
4336
- name: Install Package dependencies
4437
run: yarn install
@@ -57,13 +50,13 @@ jobs:
5750
timeout-minutes: 10
5851
strategy:
5952
matrix:
60-
node: ['12', '14']
53+
node: ['12', '14', '16']
6154
steps:
6255
- name: Set running flag
6356
run: echo "RUNNING=1" >> $GITHUB_ENV
6457
- uses: actions/checkout@v2
6558
- uses: technote-space/get-git-comment-action@v1
66-
- uses: technote-space/get-diff-action@v4
59+
- uses: technote-space/get-diff-action@v5
6760
with:
6861
PATTERNS: +(src|__tests__)/**/*.+(js|ts|snap)
6962
FILES: |
@@ -74,33 +67,21 @@ jobs:
7467
run: echo "RUNNING=" >> $GITHUB_ENV
7568
if: "! env.GIT_DIFF"
7669
- name: Set running flag
77-
if: "matrix.node == '12' && ! startsWith(github.ref, 'refs/tags/') && github.event.base_ref == format('refs/heads/{0}', github.event.repository.default_branch)"
70+
if: "matrix.node == '14' && ! startsWith(github.ref, 'refs/tags/') && github.event.base_ref == format('refs/heads/{0}', github.event.repository.default_branch)"
7871
run: echo "RUNNING=1" >> $GITHUB_ENV
7972
- name: Set running flag
80-
if: matrix.node == '12' && startsWith(github.ref, 'refs/tags/v')
73+
if: matrix.node == '14' && startsWith(github.ref, 'refs/tags/v')
8174
run: echo "RUNNING=1" >> $GITHUB_ENV
8275
- name: Set running flag
8376
run: |
8477
if [[ ! -f package.json ]] || ! < package.json jq -r '.scripts | keys[]' | grep -qe '^cover$'; then
8578
echo "RUNNING=" >> $GITHUB_ENV
8679
fi
8780
88-
- name: Setup node
89-
uses: actions/setup-node@v1
81+
- uses: actions/setup-node@v2
9082
with:
9183
node-version: ${{ matrix.node }}
92-
if: env.RUNNING
93-
- name: Get Yarn Cache Directory
94-
id: yarn-cache
95-
run: echo "::set-output name=dir::$(yarn cache dir)"
96-
if: env.RUNNING
97-
- name: Cache node dependencies
98-
uses: actions/cache@v2
99-
with:
100-
path: ${{ steps.yarn-cache.outputs.dir }}
101-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
102-
restore-keys: |
103-
${{ runner.os }}-yarn-
84+
cache: yarn
10485
if: env.RUNNING
10586
- name: Install Package dependencies
10687
run: yarn install
@@ -116,7 +97,7 @@ jobs:
11697
env:
11798
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
11899
COVERAGE_FILE: ./coverage/lcov.info
119-
if: env.RUNNING && matrix.node == '12'
100+
if: env.RUNNING && matrix.node == '14'
120101

121102
package:
122103
name: Publish Package
@@ -139,6 +120,11 @@ jobs:
139120
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
140121
- uses: actions/checkout@v2
141122
if: env.RUNNING
123+
- name: Check package version
124+
uses: technote-space/package-version-check-action@v1
125+
with:
126+
COMMIT_DISABLED: 1
127+
if: env.RUNNING
142128
- name: Set running flag
143129
run: npx can-npm-publish || echo "RUNNING=" >> $GITHUB_ENV
144130
if: env.RUNNING && matrix.target == 'npm'
@@ -154,34 +140,19 @@ jobs:
154140
if: env.RUNNING && matrix.target == 'gpr'
155141

156142
- name: Setup Node.js
157-
uses: actions/setup-node@v1
143+
uses: actions/setup-node@v2
158144
with:
159-
node-version: 12
145+
node-version: 14
160146
registry-url: https://registry.npmjs.org/
147+
cache: yarn
161148
if: env.RUNNING && matrix.target == 'npm'
162149
- name: Setup Node.js
163-
uses: actions/setup-node@v1
150+
uses: actions/setup-node@v2
164151
with:
165-
node-version: 12
152+
node-version: 14
166153
registry-url: https://npm.pkg.github.com
154+
cache: yarn
167155
if: env.RUNNING && matrix.target == 'gpr'
168-
- name: Get Yarn Cache Directory
169-
id: yarn-cache
170-
run: echo "::set-output name=dir::$(yarn cache dir)"
171-
if: env.RUNNING
172-
- name: Cache node dependencies
173-
uses: actions/cache@v2
174-
with:
175-
path: ${{ steps.yarn-cache.outputs.dir }}
176-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
177-
restore-keys: |
178-
${{ runner.os }}-yarn-
179-
if: env.RUNNING
180-
- name: Check package version
181-
uses: technote-space/package-version-check-action@v1
182-
with:
183-
COMMIT_DISABLED: 1
184-
if: env.RUNNING
185156
- name: Install Package dependencies
186157
run: yarn install
187158
if: env.RUNNING
@@ -235,7 +206,7 @@ jobs:
235206
timeout-minutes: 3
236207
if: always()
237208
steps:
238-
- uses: technote-space/workflow-conclusion-action@v1
209+
- uses: technote-space/workflow-conclusion-action@v2
239210
- uses: 8398a7/action-slack@v3
240211
with:
241212
status: failure

.github/workflows/issue-opened.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212
steps:
1313
- uses: technote-space/load-config-action@v1
1414
with:
15-
CONFIG_FILENAME: workflow-settings.json
15+
CONFIG_FILENAME: workflow-settings.json, workflow-details.json
16+
IGNORE_WARNING: 'true'
1617
- uses: technote-space/create-project-card-action@v1
1718
with:
1819
PROJECT: ${{ env.PROJECT }}

.github/workflows/pr-opened.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212
steps:
1313
- uses: technote-space/load-config-action@v1
1414
with:
15-
CONFIG_FILENAME: workflow-settings.json
15+
CONFIG_FILENAME: workflow-settings.json, workflow-details.json
16+
IGNORE_WARNING: 'true'
1617
- uses: technote-space/create-project-card-action@v1
1718
with:
1819
PROJECT: ${{ env.PROJECT }}

.github/workflows/pr-updated.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
on: pull_request_target
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
36
name: Pull Request updated
47

58
jobs:
@@ -21,13 +24,15 @@ jobs:
2124
steps:
2225
- uses: technote-space/load-config-action@v1
2326
with:
24-
CONFIG_FILENAME: workflow-settings.json
27+
CONFIG_FILENAME: workflow-settings.json, workflow-details.json
28+
IGNORE_WARNING: 'true'
2529
- uses: technote-space/pr-commit-body-action@v1
2630
with:
2731
EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }}
2832
TITLE: ${{ env.PR_BODY_TITLE }}
2933
LINK_ISSUE_KEYWORD: ${{ (startsWith(github.head_ref, 'release/') && 'closes') || '' }}
3034
FILTER_PR: true
35+
CHANGE_TEMPLATE: ${{ env.CHANGE_TEMPLATE }}
3136

3237
manageRelease:
3338
name: Manage release
@@ -37,7 +42,8 @@ jobs:
3742
steps:
3843
- uses: technote-space/load-config-action@v1
3944
with:
40-
CONFIG_FILENAME: workflow-settings.json
45+
CONFIG_FILENAME: workflow-settings.json, workflow-details.json
46+
IGNORE_WARNING: 'true'
4147
- uses: technote-space/release-type-action@v1
4248
with:
4349
EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }}
@@ -51,7 +57,8 @@ jobs:
5157
steps:
5258
- uses: technote-space/load-config-action@v1
5359
with:
54-
CONFIG_FILENAME: workflow-settings.json
60+
CONFIG_FILENAME: workflow-settings.json, workflow-details.json
61+
IGNORE_WARNING: 'true'
5562
- name: Set running flag
5663
run: echo "RUNNING=1" >> $GITHUB_ENV
5764
- uses: actions/checkout@v2

.github/workflows/toc.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ on:
22
pull_request:
33
types: [opened, synchronize, reopened, closed]
44

5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
58
name: TOC Generator
69

710
jobs:
@@ -13,11 +16,15 @@ jobs:
1316
steps:
1417
- uses: technote-space/load-config-action@v1
1518
with:
16-
CONFIG_FILENAME: workflow-settings.json
17-
- uses: technote-space/toc-generator@v2
19+
CONFIG_FILENAME: workflow-settings.json, workflow-details.json
20+
IGNORE_WARNING: 'true'
21+
- uses: technote-space/toc-generator@v4
1822
with:
1923
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
2024
TARGET_BRANCH_PREFIX: ${{ env.BRANCH_PREFIX }}
2125
FOLDING: ${{ env.TOC_FOLDING }}
2226
MAX_HEADER_LEVEL: ${{ env.TOC_MAX_HEADER_LEVEL }}
2327
TOC_TITLE: ${{ env.TOC_TITLE }}
28+
CREATE_PR: ${{ env.TOC_CREATE_PR }}
29+
TARGET_PATHS: ${{ env.TOC_TARGET_PATHS }}
30+
FOOTER: ${{ env.TOC_FOOTER }}

0 commit comments

Comments
 (0)