diff --git a/.github/workflow-settings.json b/.github/workflow-settings.json new file mode 100644 index 0000000..7cd34a6 --- /dev/null +++ b/.github/workflow-settings.json @@ -0,0 +1,17 @@ +{ + "EXCLUDE_MESSAGES": [ + "update package version", + "update packages", + "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/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/ci.yml b/.github/workflows/ci.yml index a47ddfe..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.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') @@ -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 1e53bd6..a30b14f 100644 --- a/.github/workflows/pr-updated.yml +++ b/.github/workflows/pr-updated.yml @@ -17,14 +17,13 @@ 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 - TITLE: '## Changes' + EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }} + TITLE: ${{ env.PR_BODY_TITLE }} 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/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 }} 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/}"