Skip to content

Commit ed968a6

Browse files
Merge pull request #183 from technote-space/chore/chore-sync-workflows
chore: sync workflows
2 parents f8d4e3f + af6cf48 commit ed968a6

File tree

7 files changed

+23
-74
lines changed

7 files changed

+23
-74
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
tag:
1111
name: Add version tag
1212
runs-on: ubuntu-latest
13-
if: github.event.pull_request.merged == true && 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.event.pull_request.head.ref, 'release/')
1414
steps:
1515
- name: Get version
1616
run: echo "::set-env name=TAG_NAME::${HEAD_REF#release/}"

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ jobs:
8282
- name: Set running flag
8383
if: matrix.node == '12' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
8484
run: echo "::set-env name=RUNNING::1"
85+
- name: Set running flag
86+
if: matrix.node == '12' && startsWith(github.ref, 'refs/tags/v')
87+
run: echo "::set-env name=RUNNING::1"
8588
- name: Set running flag
8689
run: |
8790
if [[ ! -f package.json ]] || ! < package.json jq -r '.scripts | keys[]' | grep -qe '^cover$'; then

.github/workflows/pr-opened.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ name: Pull Request opened
66

77
jobs:
88
assignToProject:
9+
if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id
910
name: Assign PullRequest to Project
1011
runs-on: ubuntu-latest
1112
steps:
@@ -37,7 +38,7 @@ jobs:
3738
checkVersion:
3839
name: Check package version
3940
runs-on: ubuntu-latest
40-
if: startsWith(github.event.pull_request.head.ref, 'release/')
41+
if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.event.pull_request.head.ref, 'release/')
4142
steps:
4243
- name: Set running flag
4344
run: echo "::set-env name=RUNNING::1"

.github/workflows/pr-updated.yml

Lines changed: 14 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -18,84 +18,30 @@ jobs:
1818
history:
1919
name: Pull Request Body
2020
runs-on: ubuntu-latest
21-
if: startsWith(github.event.pull_request.head.ref, 'release/')
21+
if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id
2222
steps:
2323
- name: Pull Request Body
2424
uses: technote-space/pr-commit-body-action@v1
2525
with:
2626
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2727
EXCLUDE_MESSAGES: |
2828
trigger workflow
29-
Update TOC
30-
Update package version
29+
update TOC
30+
update package version
31+
update wp version
3132
TITLE: '## Changes'
33+
LINK_ISSUE_KEYWORD: ${{ (startsWith(github.event.pull_request.head.ref, 'release/') && 'closes') || '' }}
34+
FILTER_PR: true
3235

33-
assignToProject:
34-
name: Assign PullRequest to Project
36+
manageRelease:
37+
name: Manage release
3538
runs-on: ubuntu-latest
36-
if: github.event.action == 'synchronize'
39+
if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.event.pull_request.head.ref, 'release/')
3740
steps:
38-
- uses: actions/checkout@v2
39-
- uses: technote-space/get-git-comment-action@v1
40-
- name: Assign PullRequest to Project
41-
if: contains(env.COMMIT_MESSAGE, 'trigger workflow')
42-
uses: technote-space/create-project-card-action@v1
43-
with:
44-
PROJECT: Backlog
45-
COLUMN: To do
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
IGNORE_CONTEXT_CHECK: true
48-
49-
assignAuthor:
50-
name: Assign author to PR
51-
runs-on: ubuntu-latest
52-
if: github.event.action == 'synchronize'
53-
steps:
54-
- uses: actions/checkout@v2
55-
- uses: technote-space/get-git-comment-action@v1
56-
- name: Assign Author to PR
57-
if: contains(env.COMMIT_MESSAGE, 'trigger workflow')
58-
uses: technote-space/assign-author@v1
59-
with:
60-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
IGNORE_CONTEXT_CHECK: true
62-
63-
addLabelsByBranch:
64-
name: PR Labeler
65-
runs-on: ubuntu-latest
66-
if: github.event.action == 'synchronize'
67-
steps:
68-
- uses: actions/checkout@v2
69-
- uses: technote-space/get-git-comment-action@v1
70-
- name: PR Labeler
71-
if: contains(env.COMMIT_MESSAGE, 'trigger workflow')
72-
uses: technote-space/pr-labeler-action@v3
73-
with:
74-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75-
IGNORE_CONTEXT_CHECK: true
76-
77-
checkVersion:
78-
name: Check package version
79-
runs-on: ubuntu-latest
80-
if: github.event.action == 'synchronize' && startsWith(github.event.pull_request.head.ref, 'release/')
81-
steps:
82-
- name: Set running flag
83-
run: echo "::set-env name=RUNNING::"
84-
- uses: actions/checkout@v2
85-
- uses: technote-space/get-git-comment-action@v1
86-
- name: Set running flag
87-
run: echo "::set-env name=RUNNING::1"
88-
if: contains(env.COMMIT_MESSAGE, 'trigger workflow')
89-
- name: Set running flag
90-
run: |
91-
if [[ ! -f package.json ]] || [[ $(< package.json jq -r '.version == null') == 'true' ]]; then
92-
echo "::set-env name=RUNNING::"
93-
fi
94-
95-
- name: Check package version
96-
uses: technote-space/package-version-check-action@v1
41+
- name: Manage release
42+
uses: technote-space/manage-release-action@v1
9743
with:
9844
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
99-
BRANCH_PREFIX: release/
100-
IGNORE_CONTEXT_CHECK: true
101-
if: env.RUNNING
45+
EXCLUDE_MESSAGES: |
46+
update package version
47+
update packages

.github/workflows/sync-workflows.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
uses: technote-space/create-pr-action@v1
1515
with:
1616
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
17-
API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1817
EXECUTE_COMMANDS: |
1918
rm -rdf .github/workflows/.tmp
2019
mkdir -p .github/workflows/.tmp

.github/workflows/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ name: TOC Generator
66

77
jobs:
88
toc:
9+
if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id
910
name: TOC Generator
1011
runs-on: ubuntu-latest
1112
steps:
1213
- name: TOC Generator
1314
uses: technote-space/toc-generator@v2
1415
with:
1516
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
16-
API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1717
TARGET_BRANCH_PREFIX: release/
1818
FOLDING: true
1919
MAX_HEADER_LEVEL: 3

.github/workflows/update-dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
uses: technote-space/create-pr-action@v1
1717
with:
1818
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
19-
API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2019
EXECUTE_COMMANDS: |
2120
npx npm-check-updates -u --packageFile package.json
2221
yarn install
@@ -27,5 +26,6 @@ jobs:
2726
PR_TITLE: 'chore: update npm dependencies (${PR_MERGE_REF})'
2827
PR_DEFAULT_BRANCH_PREFIX: release/
2928
PR_DEFAULT_BRANCH_NAME: ${PATCH_VERSION}
30-
PR_DEFAULT_BRANCH_TITLE: release/${PATCH_VERSION}
29+
PR_DEFAULT_BRANCH_TITLE: 'feat: release ${PATCH_VERSION}'
3130
TARGET_BRANCH_PREFIX: release/
31+
AUTO_MERGE_THRESHOLD_DAYS: 30

0 commit comments

Comments
 (0)