Skip to content

Commit 9c98a09

Browse files
Merge pull request #166 from technote-space/chore/chore-sync-workflows
chore: sync workflows
2 parents 3caf3cf + b3083d2 commit 9c98a09

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,21 @@ jobs:
1313
- uses: actions/checkout@v2
1414
- uses: technote-space/get-git-comment-action@v1
1515
- name: Get version
16-
run: echo "::set-env name=TAG_NAME::${HEAD_REF#release/}.${RUN_ID}"
16+
uses: technote-space/get-next-version-action@v1
17+
with:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
if: "github.event.pull_request.head.ref == 'release/next' && (contains(env.COMMIT_MESSAGE, 'chore: update dependencies') || contains(env.COMMIT_MESSAGE, 'chore: update npm dependencies'))"
20+
- name: Get version
21+
run: echo "::set-env name=NEXT_VERSION::${HEAD_REF#release/}"
22+
env:
23+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
24+
if: "startsWith(github.event.pull_request.head.ref, 'release/v') && (contains(env.COMMIT_MESSAGE, 'chore: update dependencies') || contains(env.COMMIT_MESSAGE, 'chore: update npm dependencies'))"
25+
- name: Get tag name
26+
run: echo "::set-env name=TAG_NAME::${NEXT_VERSION}.${RUN_ID}"
1727
env:
1828
HEAD_REF: ${{ github.event.pull_request.head.ref }}
1929
RUN_ID: ${{ github.run_id }}
20-
if: "contains(env.COMMIT_MESSAGE, 'chore: update dependencies') || contains(env.COMMIT_MESSAGE, 'chore: update npm dependencies')"
30+
if: env.NEXT_VERSION
2131
- uses: actions/[email protected]
2232
with:
2333
github-token: ${{ secrets.ACCESS_TOKEN }}
@@ -28,4 +38,4 @@ jobs:
2838
ref: `refs/tags/test/${process.env.TAG_NAME}`,
2939
sha: context.payload.pull_request.head.sha
3040
})
31-
if: "contains(env.COMMIT_MESSAGE, 'chore: update dependencies') || contains(env.COMMIT_MESSAGE, 'chore: update npm dependencies')"
41+
if: env.TAG_NAME

.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: github.event.pull_request.head.ref == 'release/next'
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/[email protected]
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,18 @@ 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 && github.event.pull_request.head.ref == 'release/next'
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: |

.github/workflows/update-dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
PR_BRANCH_NAME: 'chore-npm-update-${PR_ID}'
2626
PR_TITLE: 'chore: update npm dependencies (${PR_MERGE_REF})'
2727
PR_DEFAULT_BRANCH_PREFIX: release/
28-
PR_DEFAULT_BRANCH_NAME: ${PATCH_VERSION}
28+
PR_DEFAULT_BRANCH_NAME: next
2929
PR_DEFAULT_BRANCH_TITLE: 'feat: release ${PATCH_VERSION}'
3030
TARGET_BRANCH_PREFIX: release/
31-
AUTO_MERGE_THRESHOLD_DAYS: 30
31+
AUTO_MERGE_THRESHOLD_DAYS: 14

0 commit comments

Comments
 (0)