From 563de54e03bbbf5309bd108622e07b9fd275fd67 Mon Sep 17 00:00:00 2001 From: technote-space Date: Thu, 19 Mar 2020 15:04:21 +0000 Subject: [PATCH 1/3] chore: sync workflows --- .github/workflow-settings.json | 9 +++++++++ .github/workflows/add-release-tag.yml | 7 ++++--- .github/workflows/pr-updated.yml | 23 ++++++++++++----------- .github/workflows/update-dependencies.yml | 7 ++++--- 4 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 .github/workflow-settings.json diff --git a/.github/workflow-settings.json b/.github/workflow-settings.json new file mode 100644 index 0000000..2610817 --- /dev/null +++ b/.github/workflow-settings.json @@ -0,0 +1,9 @@ +{ + "EXCLUDE_MESSAGES": [ + "update package version", + "update packages", + "update wp version", + "trigger workflow", + "update TOC" + ] +} \ No newline at end of file diff --git a/.github/workflows/add-release-tag.yml b/.github/workflows/add-release-tag.yml index 3e3f316..60e9f8f 100644 --- a/.github/workflows/add-release-tag.yml +++ b/.github/workflows/add-release-tag.yml @@ -12,12 +12,13 @@ jobs: runs-on: ubuntu-latest 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/') steps: + - uses: technote-space/load-config-action@v1 + with: + CONFIG_FILENAME: workflow-settings.json - name: Get version uses: technote-space/get-next-version-action@v1 with: - EXCLUDE_MESSAGES: | - update package version - update packages + EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }} if: "! startsWith(github.head_ref, 'release/v')" - name: Get version run: echo "::set-env name=NEXT_VERSION::${HEAD_REF#release/}" diff --git a/.github/workflows/pr-updated.yml b/.github/workflows/pr-updated.yml index 1e53bd6..ff69814 100644 --- a/.github/workflows/pr-updated.yml +++ b/.github/workflows/pr-updated.yml @@ -17,13 +17,12 @@ jobs: runs-on: ubuntu-latest if: github.event.pull_request.head.user.id == github.event.pull_request.base.user.id steps: + - uses: technote-space/load-config-action@v1 + with: + CONFIG_FILENAME: workflow-settings.json - uses: technote-space/pr-commit-body-action@v1 with: - EXCLUDE_MESSAGES: | - trigger workflow - update TOC - update package version - update wp version + EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }} TITLE: '## Changes' LINK_ISSUE_KEYWORD: ${{ (startsWith(github.head_ref, 'release/') && 'closes') || '' }} FILTER_PR: true @@ -33,18 +32,22 @@ jobs: runs-on: ubuntu-latest 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')" steps: + - uses: technote-space/load-config-action@v1 + with: + CONFIG_FILENAME: workflow-settings.json - uses: technote-space/release-type-action@v1 with: + EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }} GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} - EXCLUDE_MESSAGES: | - update package version - update packages checkVersion: name: Check package version runs-on: ubuntu-latest 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')" steps: + - uses: technote-space/load-config-action@v1 + with: + CONFIG_FILENAME: workflow-settings.json - name: Set running flag run: echo "::set-env name=RUNNING::1" - uses: actions/checkout@v2 @@ -57,9 +60,7 @@ jobs: - name: Get version uses: technote-space/get-next-version-action@v1 with: - EXCLUDE_MESSAGES: | - update package version - update packages + EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }} if: env.RUNNING - name: Check package version uses: technote-space/package-version-check-action@v1 diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index f200fcd..df92e21 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -12,6 +12,9 @@ jobs: name: Update npm dependencies runs-on: ubuntu-latest steps: + - uses: technote-space/load-config-action@v1 + with: + CONFIG_FILENAME: workflow-settings.json - uses: technote-space/auto-cancel-redundant-job@v1 with: EXCLUDE_MERGED: 'true' @@ -49,9 +52,7 @@ jobs: - name: Get version uses: technote-space/get-next-version-action@v1 with: - EXCLUDE_MESSAGES: | - update package version - update packages + EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }} if: "env.RUNNING && ! startsWith(github.head_ref, 'release/v')" - name: Get version run: echo "::set-env name=NEXT_VERSION::${HEAD_REF#release/}" From a91207f485b9780de2f7dea61832edd45985a852 Mon Sep 17 00:00:00 2001 From: technote-space Date: Sat, 21 Mar 2020 04:39:39 +0000 Subject: [PATCH 2/3] chore: sync workflows --- .github/workflow-settings.json | 10 +++++++++- .github/workflows/ci.yml | 6 +++--- .github/workflows/issue-opened.yml | 7 +++++-- .github/workflows/pr-opened.yml | 7 +++++-- .github/workflows/pr-updated.yml | 2 +- .github/workflows/toc.yml | 11 +++++++---- 6 files changed, 30 insertions(+), 13 deletions(-) diff --git a/.github/workflow-settings.json b/.github/workflow-settings.json index 2610817..7cd34a6 100644 --- a/.github/workflow-settings.json +++ b/.github/workflow-settings.json @@ -5,5 +5,13 @@ "update wp version", "trigger workflow", "update TOC" - ] + ], + "PROJECT": "Backlog", + "ISSUE_COLUMN": "To do", + "PR_COLUMN": "In progress", + "PR_BODY_TITLE": "## Changes", + "TOC_FOLDING": "1", + "TOC_MAX_HEADER_LEVEL": "3", + "TOC_TITLE": "Details", + "BRANCH_PREFIX": "release/" } \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a47ddfe..da011d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: run: echo "::set-env name=RUNNING::" if: "! env.GIT_DIFF" - name: Set running flag - if: matrix.node == '12' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + if: matrix.node == '12' && github.base_ref == format('refs/heads/{0}', github.event.repository.default_branch) run: echo "::set-env name=RUNNING::1" - name: Set running flag if: matrix.node == '12' && startsWith(github.ref, 'refs/tags/v') @@ -232,7 +232,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - if: success() + if: success() && env.SLACK_WEBHOOK_URL slack: name: Slack @@ -247,4 +247,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - if: env.WORKFLOW_CONCLUSION == 'failure' + if: env.WORKFLOW_CONCLUSION == 'failure' && env.SLACK_WEBHOOK_URL diff --git a/.github/workflows/issue-opened.yml b/.github/workflows/issue-opened.yml index 1972013..6661eb2 100644 --- a/.github/workflows/issue-opened.yml +++ b/.github/workflows/issue-opened.yml @@ -9,10 +9,13 @@ jobs: name: Assign issues to project runs-on: ubuntu-latest steps: + - uses: technote-space/load-config-action@v1 + with: + CONFIG_FILENAME: workflow-settings.json - uses: technote-space/create-project-card-action@v1 with: - PROJECT: Backlog - COLUMN: To do + PROJECT: ${{ env.PROJECT }} + COLUMN: ${{ env.ISSUE_COLUMN }} assignAuthor: name: Assign author to issue diff --git a/.github/workflows/pr-opened.yml b/.github/workflows/pr-opened.yml index 9c6ad6d..c988fcc 100644 --- a/.github/workflows/pr-opened.yml +++ b/.github/workflows/pr-opened.yml @@ -10,10 +10,13 @@ jobs: name: Assign PullRequest to Project runs-on: ubuntu-latest steps: + - uses: technote-space/load-config-action@v1 + with: + CONFIG_FILENAME: workflow-settings.json - uses: technote-space/create-project-card-action@v1 with: - PROJECT: Backlog - COLUMN: In progress + PROJECT: ${{ env.PROJECT }} + COLUMN: ${{ env.PR_COLUMN }} GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} assignAuthor: diff --git a/.github/workflows/pr-updated.yml b/.github/workflows/pr-updated.yml index ff69814..a30b14f 100644 --- a/.github/workflows/pr-updated.yml +++ b/.github/workflows/pr-updated.yml @@ -23,7 +23,7 @@ jobs: - uses: technote-space/pr-commit-body-action@v1 with: EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }} - TITLE: '## Changes' + TITLE: ${{ env.PR_BODY_TITLE }} LINK_ISSUE_KEYWORD: ${{ (startsWith(github.head_ref, 'release/') && 'closes') || '' }} FILTER_PR: true diff --git a/.github/workflows/toc.yml b/.github/workflows/toc.yml index b343c8c..d273ee3 100644 --- a/.github/workflows/toc.yml +++ b/.github/workflows/toc.yml @@ -10,10 +10,13 @@ jobs: name: TOC Generator runs-on: ubuntu-latest steps: + - uses: technote-space/load-config-action@v1 + with: + CONFIG_FILENAME: workflow-settings.json - uses: technote-space/toc-generator@v2 with: GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} - TARGET_BRANCH_PREFIX: release/ - FOLDING: true - MAX_HEADER_LEVEL: 3 - TOC_TITLE: Details + TARGET_BRANCH_PREFIX: ${{ env.BRANCH_PREFIX }} + FOLDING: ${{ env.TOC_FOLDING }} + MAX_HEADER_LEVEL: ${{ env.TOC_MAX_HEADER_LEVEL }} + TOC_TITLE: ${{ env.TOC_TITLE }} From 3ccef070cfe84454fe53bbe22fcdeda791d83cf2 Mon Sep 17 00:00:00 2001 From: technote-space Date: Sat, 21 Mar 2020 04:45:12 +0000 Subject: [PATCH 3/3] chore: sync workflows --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da011d3..ba68264 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: run: echo "::set-env name=RUNNING::" if: "! env.GIT_DIFF" - name: Set running flag - if: matrix.node == '12' && github.base_ref == format('refs/heads/{0}', github.event.repository.default_branch) + if: "matrix.node == '12' && ! startsWith(github.ref, 'refs/tags/') && github.event.base_ref == format('refs/heads/{0}', github.event.repository.default_branch)" run: echo "::set-env name=RUNNING::1" - name: Set running flag if: matrix.node == '12' && startsWith(github.ref, 'refs/tags/v')