Skip to content

Commit

Permalink
Merge pull request #198 from technote-space/chore/chore-sync-workflows
Browse files Browse the repository at this point in the history
chore: sync workflows
  • Loading branch information
technote-space authored Aug 17, 2020
2 parents aeb325b + 78574cb commit 07b9ac4
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/add-release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ on:
pull_request:
branches:
- master
- main
- develop/v*
types: [closed]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/broken-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
with:
EXCLUDE_MERGED: 'true'
- name: Broken Link Check
uses: technote-space/broken-link-checker-action@v1
uses: technote-space/broken-link-checker-action@v2
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
run: echo "::set-env name=RUNNING::1"
- uses: actions/checkout@v2
- uses: technote-space/get-git-comment-action@v1
- uses: technote-space/get-diff-action@v1
- uses: technote-space/get-diff-action@v3
with:
PREFIX_FILTER: |
src/
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
run: echo "::set-env name=RUNNING::1"
- uses: actions/checkout@v2
- uses: technote-space/get-git-comment-action@v1
- uses: technote-space/get-diff-action@v1
- uses: technote-space/get-diff-action@v3
with:
PREFIX_FILTER: |
src/
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pr-opened.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
on:
pull_request:
pull_request_target:
types: [opened]

name: Pull Request opened

jobs:
assignToProject:
if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id
name: Assign PullRequest to Project
runs-on: ubuntu-latest
timeout-minutes: 3
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/pr-updated.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on: pull_request
on: pull_request_target

name: Pull Request updated

Expand Down Expand Up @@ -55,6 +55,8 @@ jobs:
- name: Set running flag
run: echo "::set-env name=RUNNING::1"
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Set running flag
run: |
if [[ ! -f package.json ]] || [[ $(< package.json jq -r '.version == null') == 'true' ]]; then
Expand Down Expand Up @@ -96,6 +98,8 @@ jobs:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
if: env.RUNNING
- uses: technote-space/can-npm-publish-action@v1
if: env.RUNNING
22 changes: 15 additions & 7 deletions .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@ jobs:
timeout-minutes: 10
if: "! startsWith(github.head_ref, 'release/v')"
steps:
- name: Set running flag
run: echo "::set-env name=RUNNING1::"
- name: Set running flag
run: echo "::set-env name=RUNNING1::1"
if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id
- uses: technote-space/load-config-action@v1
if: env.RUNNING1
with:
CONFIG_FILENAME: workflow-settings.json
- uses: technote-space/auto-cancel-redundant-job@v1
if: env.RUNNING1
with:
EXCLUDE_MERGED: 'true'
- name: Update dependencies
if: env.RUNNING1
id: update_deps
uses: technote-space/create-pr-action@v2
with:
Expand All @@ -39,27 +47,27 @@ jobs:
AUTO_MERGE_THRESHOLD_DAYS: 14

- name: Set running flag
run: echo "::set-env name=RUNNING::"
run: echo "::set-env name=RUNNING2::"
- name: Set running flag
run: echo "::set-env name=RUNNING::1"
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/')
run: echo "::set-env name=RUNNING2::1"
if: env.RUNNING1 && steps.update_deps.outputs.result != 'succeeded' && github.event_name == 'pull_request' && github.event.action != 'closed' && startsWith(github.head_ref, 'release/')
- uses: actions/checkout@v2
if: env.RUNNING
if: env.RUNNING2
- name: Set running flag
run: |
if [[ ! -f package.json ]] || [[ $(< package.json jq -r '.version == null') == 'true' ]]; then
echo "::set-env name=RUNNING::"
echo "::set-env name=RUNNING2::"
fi
- name: Get version
uses: technote-space/get-next-version-action@v1
with:
EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }}
if: "env.RUNNING && ! startsWith(github.head_ref, 'release/v')"
if: "env.RUNNING2 && ! startsWith(github.head_ref, 'release/v')"
- name: Get version
run: echo "::set-env name=NEXT_VERSION::${HEAD_REF#release/}"
env:
HEAD_REF: ${{ github.head_ref }}
if: env.RUNNING && startsWith(github.head_ref, 'release/v')
if: env.RUNNING2 && startsWith(github.head_ref, 'release/v')
- name: Check package version
uses: technote-space/package-version-check-action@v1
with:
Expand Down

0 comments on commit 07b9ac4

Please sign in to comment.