Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit 9d59763

Browse files
Merge pull request #316 from technote-space/chore/chore-sync-workflows
chore: sync workflows
2 parents 0c3d359 + f8d4ff1 commit 9d59763

File tree

10 files changed

+90
-82
lines changed

10 files changed

+90
-82
lines changed
Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@ on:
44
- master
55
types: [closed]
66

7-
name: Add version tag
7+
name: Add release tag
88

99
jobs:
1010
tag:
11-
name: Add version tag
11+
name: Add release tag
1212
runs-on: ubuntu-latest
13-
if: github.event.pull_request.merged == true && github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.event.pull_request.head.ref, 'release/')
13+
if: github.event.pull_request.merged == true && github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.head_ref, 'release/')
1414
steps:
1515
- name: Get version
1616
uses: technote-space/get-next-version-action@v1
1717
with:
18-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
if: "! startsWith(github.event.pull_request.head.ref, 'release/v')"
18+
EXCLUDE_MESSAGES: |
19+
update package version
20+
update packages
21+
if: "! startsWith(github.head_ref, 'release/v')"
2022
- name: Get version
2123
run: echo "::set-env name=NEXT_VERSION::${HEAD_REF#release/}"
2224
env:
23-
HEAD_REF: ${{ github.event.pull_request.head.ref }}
24-
if: startsWith(github.event.pull_request.head.ref, 'release/v')
25+
HEAD_REF: ${{ github.head_ref }}
26+
if: startsWith(github.head_ref, 'release/v')
2527
- uses: actions/github-script@0.4.0
2628
with:
2729
github-token: ${{ secrets.ACCESS_TOKEN }}
@@ -33,3 +35,14 @@ jobs:
3335
sha: context.sha
3436
})
3537
if: env.NEXT_VERSION
38+
- uses: actions/github-script@0.4.0
39+
with:
40+
github-token: ${{ secrets.ACCESS_TOKEN }}
41+
script: |
42+
github.git.createRef({
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
ref: `refs/heads/release/next-${process.env.NEXT_VERSION}`,
46+
sha: context.sha
47+
})
48+
if: env.NEXT_VERSION
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
on:
2+
schedule:
3+
- cron: 0 0 8 * *
4+
repository_dispatch:
5+
types: [check-link]
6+
7+
name: Broken Link Check
8+
jobs:
9+
check:
10+
name: Broken Link Check
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: technote-space/auto-cancel-redundant-job@v1
14+
with:
15+
EXCLUDE_MERGED: 'true'
16+
- name: Broken Link Check
17+
uses: technote-space/broken-link-checker-action@v1

.github/workflows/check-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
checkVersion:
99
name: Check version
1010
runs-on: ubuntu-latest
11-
if: startsWith(github.event.pull_request.head.ref, 'release/')
11+
if: startsWith(github.head_ref, 'release/')
1212
steps:
1313
- name: Set running flag
1414
run: echo "::set-env name=RUNNING::1"

.github/workflows/ci.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ jobs:
1313
env:
1414
LINT: 1
1515
steps:
16+
- uses: technote-space/auto-cancel-redundant-job@v1
17+
with:
18+
EXCLUDE_MERGED: 'true'
1619
- name: Set running flag
1720
run: echo "::set-env name=RUNNING::1"
1821
- uses: actions/checkout@v2
1922
- uses: technote-space/get-git-comment-action@v1
2023
- uses: technote-space/get-diff-action@v1
2124
with:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2325
PREFIX_FILTER: assets/js/
2426
SUFFIX_FILTER: |
2527
.js
@@ -61,7 +63,6 @@ jobs:
6163
- uses: technote-space/get-git-comment-action@v1
6264
- uses: technote-space/get-diff-action@v1
6365
with:
64-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6566
PREFIX_FILTER: |
6667
configs/
6768
src/
@@ -103,7 +104,6 @@ jobs:
103104
- uses: technote-space/get-git-comment-action@v1
104105
- uses: technote-space/get-diff-action@v1
105106
with:
106-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107107
PREFIX_FILTER: |
108108
configs/
109109
src/
@@ -148,7 +148,6 @@ jobs:
148148
- uses: technote-space/get-git-comment-action@v1
149149
- uses: technote-space/get-diff-action@v1
150150
with:
151-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152151
PREFIX_FILTER: assets/js/
153152
SUFFIX_FILTER: |
154153
.js
@@ -235,7 +234,6 @@ jobs:
235234
- uses: technote-space/get-git-comment-action@v1
236235
- uses: technote-space/get-diff-action@v1
237236
with:
238-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
239237
PREFIX_FILTER: |
240238
configs/
241239
src/
@@ -259,9 +257,10 @@ jobs:
259257
fi
260258
261259
- name: Switch PHP version
262-
env:
263-
PHP_VERSION: ${{ matrix.php }}
264-
run: sudo ln -sf "/usr/bin/php$PHP_VERSION" /etc/alternatives/php
260+
uses: shivammathur/setup-php@v2
261+
with:
262+
php-version: ${{ matrix.php }}
263+
coverage: xdebug
265264
if: env.RUNNING
266265
- name: Get Composer Cache Directory
267266
id: composer-cache
@@ -358,9 +357,10 @@ jobs:
358357
steps:
359358
- uses: actions/checkout@v2
360359
- name: Switch PHP version
361-
env:
362-
PHP_VERSION: '5.6'
363-
run: sudo ln -sf "/usr/bin/php$PHP_VERSION" /etc/alternatives/php
360+
uses: shivammathur/setup-php@v2
361+
with:
362+
php-version: '5.6'
363+
coverage: xdebug
364364
- name: Get Composer Cache Directory
365365
id: composer-cache
366366
run: |
@@ -380,8 +380,6 @@ jobs:
380380
with:
381381
files: release.zip
382382
draft: true
383-
env:
384-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
385383

386384
publishRelease:
387385
name: Create Release
@@ -416,8 +414,6 @@ jobs:
416414
if: always()
417415
steps:
418416
- uses: technote-space/workflow-conclusion-action@v1
419-
with:
420-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
421417
- uses: 8398a7/action-slack@v2
422418
with:
423419
status: failure

.github/workflows/issue-opened.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,13 @@ jobs:
99
name: Assign issues to project
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Assign issues to project
13-
uses: technote-space/create-project-card-action@v1
12+
- uses: technote-space/create-project-card-action@v1
1413
with:
1514
PROJECT: Backlog
1615
COLUMN: To do
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1816

1917
assignAuthor:
2018
name: Assign author to issue
2119
runs-on: ubuntu-latest
2220
steps:
23-
- name: Assign author to issue
24-
uses: technote-space/assign-author@v1
25-
with:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
- uses: technote-space/assign-author@v1

.github/workflows/pr-opened.yml

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ jobs:
1010
name: Assign PullRequest to Project
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Assign PullRequest to Project
14-
uses: technote-space/create-project-card-action@v1
13+
- uses: technote-space/create-project-card-action@v1
1514
with:
1615
PROJECT: Backlog
1716
COLUMN: In progress
@@ -21,37 +20,10 @@ jobs:
2120
name: Assign author to PR
2221
runs-on: ubuntu-latest
2322
steps:
24-
- name: Assign Author to PR
25-
uses: technote-space/assign-author@v1
26-
with:
27-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
- uses: technote-space/assign-author@v1
2824

2925
addLabelsByBranch:
3026
name: PR Labeler
3127
runs-on: ubuntu-latest
3228
steps:
33-
- name: PR Labeler
34-
uses: technote-space/pr-labeler-action@v3
35-
with:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
38-
checkVersion:
39-
name: Check package version
40-
runs-on: ubuntu-latest
41-
if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.event.pull_request.head.ref, 'release/v')
42-
steps:
43-
- name: Set running flag
44-
run: echo "::set-env name=RUNNING::1"
45-
- uses: actions/checkout@v2
46-
- name: Set running flag
47-
run: |
48-
if [[ ! -f package.json ]] || [[ $(< package.json jq -r '.version == null') == 'true' ]]; then
49-
echo "::set-env name=RUNNING::"
50-
fi
51-
52-
- name: Check package version
53-
uses: technote-space/package-version-check-action@v1
54-
with:
55-
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
56-
BRANCH_PREFIX: release/
57-
if: env.RUNNING
29+
- uses: technote-space/pr-labeler-action@v3

.github/workflows/pr-updated.yml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
on:
2-
pull_request:
3-
types: [opened, synchronize]
1+
on: pull_request
42

53
name: Pull Request updated
64

75
jobs:
86
triage:
97
name: Pull Request Labeler
108
runs-on: ubuntu-latest
11-
if: "! startsWith(github.event.pull_request.head.ref, 'release/')"
9+
if: "! startsWith(github.head_ref, 'release/')"
1210
steps:
13-
- name: Pull Request Labeler
14-
uses: actions/labeler@v2
11+
- uses: actions/labeler@v2
1512
with:
1613
repo-token: ${{ secrets.GITHUB_TOKEN }}
1714

@@ -20,26 +17,23 @@ jobs:
2017
runs-on: ubuntu-latest
2118
if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id
2219
steps:
23-
- name: Pull Request Body
24-
uses: technote-space/pr-commit-body-action@v1
20+
- uses: technote-space/pr-commit-body-action@v1
2521
with:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2722
EXCLUDE_MESSAGES: |
2823
trigger workflow
2924
update TOC
3025
update package version
3126
update wp version
3227
TITLE: '## Changes'
33-
LINK_ISSUE_KEYWORD: ${{ (startsWith(github.event.pull_request.head.ref, 'release/') && 'closes') || '' }}
28+
LINK_ISSUE_KEYWORD: ${{ (startsWith(github.head_ref, 'release/') && 'closes') || '' }}
3429
FILTER_PR: true
3530

3631
manageRelease:
3732
name: Manage release
3833
runs-on: ubuntu-latest
39-
if: "github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.event.pull_request.head.ref, 'release/') && ! startsWith(github.event.pull_request.head.ref, 'release/v')"
34+
if: "github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.head_ref, 'release/') && ! startsWith(github.head_ref, 'release/v')"
4035
steps:
41-
- name: Manage release
42-
uses: technote-space/release-type-action@v1
36+
- uses: technote-space/release-type-action@v1
4337
with:
4438
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
4539
EXCLUDE_MESSAGES: |
@@ -49,7 +43,7 @@ jobs:
4943
checkVersion:
5044
name: Check package version
5145
runs-on: ubuntu-latest
52-
if: "github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.event.pull_request.head.ref, 'release/') && ! startsWith(github.event.pull_request.head.ref, 'release/v')"
46+
if: "github.event.action == 'synchronize' && github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.head_ref, 'release/') && ! startsWith(github.head_ref, 'release/v')"
5347
steps:
5448
- name: Set running flag
5549
run: echo "::set-env name=RUNNING::1"
@@ -63,7 +57,9 @@ jobs:
6357
- name: Get version
6458
uses: technote-space/get-next-version-action@v1
6559
with:
66-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
EXCLUDE_MESSAGES: |
61+
update package version
62+
update packages
6763
if: env.RUNNING
6864
- name: Check package version
6965
uses: technote-space/package-version-check-action@v1
@@ -72,3 +68,23 @@ jobs:
7268
BRANCH_PREFIX: release/
7369
NEXT_VERSION: ${{ env.NEXT_VERSION }}
7470
if: env.NEXT_VERSION
71+
72+
checkPublish:
73+
name: Check publish
74+
runs-on: ubuntu-latest
75+
if: "github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.head_ref, 'release/')"
76+
steps:
77+
- name: Set running flag
78+
run: echo "::set-env name=RUNNING::1"
79+
- name: Set running flag
80+
run: |
81+
if [ -z "$NPM_AUTH_TOKEN" ]; then
82+
echo "::set-env name=RUNNING::"
83+
fi
84+
env:
85+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
86+
87+
- uses: actions/checkout@v2
88+
if: env.RUNNING
89+
- uses: technote-space/can-npm-publish-action@v1
90+
if: env.RUNNING

.github/workflows/project-card-moved.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,4 @@ jobs:
99
name: Auto card labeler
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Auto card labeler
13-
uses: technote-space/auto-card-labeler@v1
14-
with:
15-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
- uses: technote-space/auto-card-labeler@v1

.github/workflows/toc.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ jobs:
1010
name: TOC Generator
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: TOC Generator
14-
uses: technote-space/toc-generator@v2
13+
- uses: technote-space/toc-generator@v2
1514
with:
1615
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
1716
TARGET_BRANCH_PREFIX: release/

.github/workflows/update-dependencies.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
name: Update dependencies
1919
runs-on: ubuntu-latest
2020
steps:
21+
- uses: technote-space/auto-cancel-redundant-job@v1
22+
with:
23+
EXCLUDE_MERGED: 'true'
2124
- name: Update dependencies
2225
uses: technote-space/create-pr-action@v1
2326
with:

0 commit comments

Comments
 (0)