Skip to content

Commit 4572aba

Browse files
chore: sync workflows
1 parent a8a6b0a commit 4572aba

File tree

5 files changed

+53
-34
lines changed

5 files changed

+53
-34
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ jobs:
88
tag:
99
name: Add test tag
1010
runs-on: ubuntu-latest
11-
if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.event.pull_request.head.ref, 'release/')
11+
if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.head_ref, 'release/')
1212
steps:
1313
- uses: actions/checkout@v2
1414
- uses: technote-space/get-git-comment-action@v1
1515
- name: Get version
1616
uses: technote-space/get-next-version-action@v1
1717
with:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
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'))"
19+
if: "! startsWith(github.head_ref, 'release/v') && (contains(env.COMMIT_MESSAGE, 'chore: update dependencies') || contains(env.COMMIT_MESSAGE, 'chore: update npm dependencies'))"
2020
- name: Get version
2121
run: echo "::set-env name=NEXT_VERSION::${HEAD_REF#release/}"
2222
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'))"
23+
HEAD_REF: ${{ github.head_ref }}
24+
if: "startsWith(github.head_ref, 'release/v') && (contains(env.COMMIT_MESSAGE, 'chore: update dependencies') || contains(env.COMMIT_MESSAGE, 'chore: update npm dependencies'))"
2525
- name: Get tag name
2626
run: echo "::set-env name=TAG_NAME::${NEXT_VERSION}.${RUN_ID}"
2727
env:
28-
HEAD_REF: ${{ github.event.pull_request.head.ref }}
28+
HEAD_REF: ${{ github.head_ref }}
2929
RUN_ID: ${{ github.run_id }}
3030
if: env.NEXT_VERSION
3131
- uses: actions/github-script@0.4.0

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@ jobs:
1010
tag:
1111
name: Add version 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:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
if: "! startsWith(github.event.pull_request.head.ref, 'release/v')"
19+
EXCLUDE_MESSAGES: |
20+
update package version
21+
update packages
22+
if: "! startsWith(github.head_ref, 'release/v')"
2023
- name: Get version
2124
run: echo "::set-env name=NEXT_VERSION::${HEAD_REF#release/}"
2225
env:
23-
HEAD_REF: ${{ github.event.pull_request.head.ref }}
24-
if: startsWith(github.event.pull_request.head.ref, 'release/v')
26+
HEAD_REF: ${{ github.head_ref }}
27+
if: startsWith(github.head_ref, 'release/v')
2528
- uses: actions/github-script@0.4.0
2629
with:
2730
github-token: ${{ secrets.ACCESS_TOKEN }}

.github/workflows/pr-opened.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,3 @@ jobs:
3434
uses: technote-space/pr-labeler-action@v3
3535
with:
3636
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

.github/workflows/pr-updated.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
triage:
99
name: Pull Request Labeler
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: Pull Request Labeler
1414
uses: actions/labeler@v2
@@ -30,13 +30,13 @@ jobs:
3030
update package version
3131
update wp version
3232
TITLE: '## Changes'
33-
LINK_ISSUE_KEYWORD: ${{ (startsWith(github.event.pull_request.head.ref, 'release/') && 'closes') || '' }}
33+
LINK_ISSUE_KEYWORD: ${{ (startsWith(github.head_ref, 'release/') && 'closes') || '' }}
3434
FILTER_PR: true
3535

3636
manageRelease:
3737
name: Manage release
3838
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')"
39+
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')"
4040
steps:
4141
- name: Manage release
4242
uses: technote-space/release-type-action@v1
@@ -49,7 +49,7 @@ jobs:
4949
checkVersion:
5050
name: Check package version
5151
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')"
52+
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')"
5353
steps:
5454
- name: Set running flag
5555
run: echo "::set-env name=RUNNING::1"
@@ -64,6 +64,9 @@ jobs:
6464
uses: technote-space/get-next-version-action@v1
6565
with:
6666
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
EXCLUDE_MESSAGES: |
68+
update package version
69+
update packages
6770
if: env.RUNNING
6871
- name: Check package version
6972
uses: technote-space/package-version-check-action@v1

.github/workflows/update-dependencies.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Update dependencies
16+
id: update_deps
1617
uses: technote-space/create-pr-action@v1
1718
with:
1819
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
@@ -29,3 +30,36 @@ jobs:
2930
PR_DEFAULT_BRANCH_TITLE: 'feat: release'
3031
TARGET_BRANCH_PREFIX: release/
3132
AUTO_MERGE_THRESHOLD_DAYS: 14
33+
34+
- name: Set running flag
35+
run: echo "::set-env name=RUNNING::"
36+
- name: Set running flag
37+
run: echo "::set-env name=RUNNING::1"
38+
if: steps.update_deps.outputs.result != 'succeeded' && github.event_name == 'pull_request' && github.event.action != 'closed' && github.event.pull_request.head.user.id == github.event.pull_request.base.user.id && startsWith(github.head_ref, 'release/')
39+
- uses: actions/checkout@v2
40+
if: env.RUNNING
41+
- name: Set running flag
42+
run: |
43+
if [[ ! -f package.json ]] || [[ $(< package.json jq -r '.version == null') == 'true' ]]; then
44+
echo "::set-env name=RUNNING::"
45+
fi
46+
- name: Get version
47+
uses: technote-space/get-next-version-action@v1
48+
with:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
EXCLUDE_MESSAGES: |
51+
update package version
52+
update packages
53+
if: "env.RUNNING && ! startsWith(github.head_ref, 'release/v')"
54+
- name: Get version
55+
run: echo "::set-env name=NEXT_VERSION::${HEAD_REF#release/}"
56+
env:
57+
HEAD_REF: ${{ github.head_ref }}
58+
if: env.RUNNING && startsWith(github.head_ref, 'release/v')
59+
- name: Check package version
60+
uses: technote-space/package-version-check-action@v1
61+
with:
62+
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
63+
BRANCH_PREFIX: release/
64+
NEXT_VERSION: ${{ env.NEXT_VERSION }}
65+
if: env.NEXT_VERSION

0 commit comments

Comments
 (0)