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

Commit 3f2e146

Browse files
chore: sync workflows
1 parent 167673d commit 3f2e146

File tree

4 files changed

+43
-8
lines changed

4 files changed

+43
-8
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,23 @@ jobs:
1313
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
16-
run: echo "::set-env name=TAG_NAME::${HEAD_REF#release/}"
16+
uses: technote-space/get-next-version-action@v1
17+
with:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
if: "! startsWith(github.event.pull_request.head.ref, 'release/v')"
20+
- name: Get version
21+
run: echo "::set-env name=NEXT_VERSION::${HEAD_REF#release/}"
1722
env:
1823
HEAD_REF: ${{ github.event.pull_request.head.ref }}
24+
if: startsWith(github.event.pull_request.head.ref, 'release/v')
1925
- uses: actions/github-script@0.4.0
2026
with:
2127
github-token: ${{ secrets.ACCESS_TOKEN }}
2228
script: |
2329
github.git.createRef({
2430
owner: context.repo.owner,
2531
repo: context.repo.repo,
26-
ref: `refs/tags/${process.env.TAG_NAME}`,
32+
ref: `refs/tags/${process.env.NEXT_VERSION}`,
2733
sha: context.sha
2834
})
35+
if: env.NEXT_VERSION

.github/workflows/pr-opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
checkVersion:
3939
name: Check package version
4040
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/')
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')
4242
steps:
4343
- name: Set running flag
4444
run: echo "::set-env name=RUNNING::1"

.github/workflows/pr-updated.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,47 @@ jobs:
2828
trigger workflow
2929
update TOC
3030
update package version
31+
update wp version
3132
TITLE: '## Changes'
3233
LINK_ISSUE_KEYWORD: ${{ (startsWith(github.event.pull_request.head.ref, 'release/') && 'closes') || '' }}
3334
FILTER_PR: true
3435

3536
manageRelease:
3637
name: Manage release
3738
runs-on: ubuntu-latest
38-
if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.event.pull_request.head.ref, 'release/')
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')"
3940
steps:
4041
- name: Manage release
41-
uses: technote-space/manage-release-action@v1
42+
uses: technote-space/release-type-action@v1
4243
with:
4344
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
4445
EXCLUDE_MESSAGES: |
4546
update package version
4647
update packages
48+
49+
checkVersion:
50+
name: Check package version
51+
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')"
53+
steps:
54+
- name: Set running flag
55+
run: echo "::set-env name=RUNNING::1"
56+
- uses: actions/checkout@v2
57+
- name: Set running flag
58+
run: |
59+
if [[ ! -f package.json ]] || [[ $(< package.json jq -r '.version == null') == 'true' ]]; then
60+
echo "::set-env name=RUNNING::"
61+
fi
62+
63+
- name: Get version
64+
uses: technote-space/get-next-version-action@v1
65+
with:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
if: env.RUNNING
68+
- name: Check package version
69+
uses: technote-space/package-version-check-action@v1
70+
with:
71+
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
72+
BRANCH_PREFIX: release/
73+
NEXT_VERSION: ${{ env.NEXT_VERSION }}
74+
if: env.NEXT_VERSION

.github/workflows/update-dependencies.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
PR_BRANCH_NAME: 'chore-update-${PR_ID}'
3030
PR_TITLE: 'chore: update dependencies (${PR_MERGE_REF})'
3131
PR_DEFAULT_BRANCH_PREFIX: release/
32-
PR_DEFAULT_BRANCH_NAME: ${PATCH_VERSION}
33-
PR_DEFAULT_BRANCH_TITLE: 'feat: release ${PATCH_VERSION}'
32+
PR_DEFAULT_BRANCH_NAME: next-${CURRENT_VERSION}
33+
PR_DEFAULT_BRANCH_TITLE: 'feat: release'
3434
TARGET_BRANCH_PREFIX: release/
35-
AUTO_MERGE_THRESHOLD_DAYS: 30
35+
AUTO_MERGE_THRESHOLD_DAYS: 14

0 commit comments

Comments
 (0)