diff --git a/.github/workflow-settings.json b/.github/workflow-settings.json index 7cd34a6..845b2e7 100644 --- a/.github/workflow-settings.json +++ b/.github/workflow-settings.json @@ -13,5 +13,18 @@ "TOC_FOLDING": "1", "TOC_MAX_HEADER_LEVEL": "3", "TOC_TITLE": "Details", - "BRANCH_PREFIX": "release/" -} \ No newline at end of file + "TOC_CREATE_PR": "true", + "TOC_TARGET_PATHS": "README*.md", + "BRANCH_PREFIX": "release/", + "ANNOTATION_EXCLUDE_PATTERNS": [ + ">> warning ", + ">> hint: ", + "Cloning into", + "has unmet peer dependency", + "has incorrect peer dependency", + "Using version", + "ci-helper", + "tests/bootstrap.php" + ], + "CHANGE_TEMPLATE": "- [ ] ${TITLE} (#${NUMBER}) @${AUTHOR}" +} diff --git a/.github/workflows/add-release-tag.yml b/.github/workflows/add-release-tag.yml index 90dd435..3c119d5 100644 --- a/.github/workflows/add-release-tag.yml +++ b/.github/workflows/add-release-tag.yml @@ -6,6 +6,9 @@ on: - develop/v* types: [closed] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + name: Add release tag jobs: @@ -17,7 +20,8 @@ jobs: steps: - uses: technote-space/load-config-action@v1 with: - CONFIG_FILENAME: workflow-settings.json + CONFIG_FILENAME: workflow-settings.json, workflow-details.json + IGNORE_WARNING: 'true' - name: Get version uses: technote-space/get-next-version-action@v1 with: @@ -28,7 +32,7 @@ jobs: env: HEAD_REF: ${{ github.head_ref }} if: startsWith(github.head_ref, 'release/v') - - uses: actions/github-script@0.4.0 + - uses: actions/github-script@v3 with: github-token: ${{ secrets.ACCESS_TOKEN }} script: | @@ -39,7 +43,7 @@ jobs: sha: context.sha }) if: env.NEXT_VERSION - - uses: actions/github-script@0.4.0 + - uses: actions/github-script@v3 with: github-token: ${{ secrets.ACCESS_TOKEN }} script: | diff --git a/.github/workflows/broken-link-check.yml b/.github/workflows/broken-link-check.yml index aeafe10..2da5a0c 100644 --- a/.github/workflows/broken-link-check.yml +++ b/.github/workflows/broken-link-check.yml @@ -1,10 +1,13 @@ on: schedule: - - cron: 27 3 4 * * + - cron: 18 18 19 * * repository_dispatch: types: [check-link] workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + name: Broken Link Check jobs: check: @@ -12,8 +15,5 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: technote-space/auto-cancel-redundant-workflow@v1 - with: - EXCLUDE_MERGED: 'true' - name: Broken Link Check uses: technote-space/broken-link-checker-action@v2 diff --git a/.github/workflows/check-warnings.yml b/.github/workflows/check-warnings.yml new file mode 100644 index 0000000..0575350 --- /dev/null +++ b/.github/workflows/check-warnings.yml @@ -0,0 +1,46 @@ +on: + workflow_run: + workflows: + - CI + - Sync workflows + - Update dependencies + - Broken Link Check + types: + - completed + +name: Check Warnings + +jobs: + annotations: + name: Annotations + runs-on: ubuntu-latest + timeout-minutes: 3 + steps: + - uses: technote-space/load-config-action@v1 + with: + CONFIG_FILENAME: workflow-settings.json, workflow-details.json + IGNORE_WARNING: 'true' + - uses: technote-space/download-annotations-action@v2 + id: annotations + with: + TARGET_RUN_ID: ${{ github.event.workflow_run.id }} + INCLUDE_LEVELS: warning + EXCLUDE_MESSAGE_PATTERNS: ${{ env.ANNOTATION_EXCLUDE_PATTERNS }} + - name: Build attachments + run: | + arr1='[{"fields":[{"title":"repo","value":"","short":true},{"title":"action","value":"<${{ github.event.workflow_run.html_url }}|summary>","short":true}]}]' + arr2=$(echo '${{ steps.annotations.outputs.messages }}' | jq -c 'map({"color":"warning","text":"```\(.)```"})') + echo "SLACK_ATTACHMENTS=$(jq --argjson arr1 "$arr1" --argjson arr2 "$arr2" -nc '$arr1 + $arr2')" >> $GITHUB_ENV + if: steps.annotations.outputs.number > 0 + - uses: 8398a7/action-slack@v3 + with: + status: custom + fields: repo + custom_payload: | + { + text: "Warning annotations", + attachments: ${{ env.SLACK_ATTACHMENTS }} + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + if: steps.annotations.outputs.number > 0 && env.SLACK_WEBHOOK_URL diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c25e17a..2d2b0f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,8 @@ on: push +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + name: CI jobs: @@ -10,14 +13,11 @@ jobs: env: LINT: 1 steps: - - uses: technote-space/auto-cancel-redundant-workflow@v1 - with: - EXCLUDE_MERGED: 'true' - name: Set running flag run: echo "RUNNING=1" >> $GITHUB_ENV - uses: actions/checkout@v2 - uses: technote-space/get-git-comment-action@v1 - - uses: technote-space/get-diff-action@v4 + - uses: technote-space/get-diff-action@v5 with: PATTERNS: +(src|__tests__)/**/*.+(js|ts) FILES: | @@ -28,17 +28,10 @@ jobs: run: echo "RUNNING=" >> $GITHUB_ENV if: "! env.GIT_DIFF" - - name: Get Yarn Cache Directory - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - if: env.RUNNING - - name: Cache node dependencies - uses: actions/cache@v2 + - uses: actions/setup-node@v2 with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + node-version: 14 + cache: yarn if: env.RUNNING - name: Install Package dependencies run: yarn install @@ -57,13 +50,13 @@ jobs: timeout-minutes: 10 strategy: matrix: - node: ['12', '14'] + node: ['12', '14', '16'] steps: - name: Set running flag run: echo "RUNNING=1" >> $GITHUB_ENV - uses: actions/checkout@v2 - uses: technote-space/get-git-comment-action@v1 - - uses: technote-space/get-diff-action@v4 + - uses: technote-space/get-diff-action@v5 with: PATTERNS: +(src|__tests__)/**/*.+(js|ts|snap) FILES: | @@ -74,10 +67,10 @@ jobs: run: echo "RUNNING=" >> $GITHUB_ENV if: "! env.GIT_DIFF" - name: Set running flag - if: "matrix.node == '12' && ! startsWith(github.ref, 'refs/tags/') && github.event.base_ref == format('refs/heads/{0}', github.event.repository.default_branch)" + if: "matrix.node == '14' && ! startsWith(github.ref, 'refs/tags/') && github.event.base_ref == format('refs/heads/{0}', github.event.repository.default_branch)" run: echo "RUNNING=1" >> $GITHUB_ENV - name: Set running flag - if: matrix.node == '12' && startsWith(github.ref, 'refs/tags/v') + if: matrix.node == '14' && startsWith(github.ref, 'refs/tags/v') run: echo "RUNNING=1" >> $GITHUB_ENV - name: Set running flag run: | @@ -85,22 +78,10 @@ jobs: echo "RUNNING=" >> $GITHUB_ENV fi - - name: Setup node - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} - if: env.RUNNING - - name: Get Yarn Cache Directory - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - if: env.RUNNING - - name: Cache node dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + cache: yarn if: env.RUNNING - name: Install Package dependencies run: yarn install @@ -116,7 +97,7 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} COVERAGE_FILE: ./coverage/lcov.info - if: env.RUNNING && matrix.node == '12' + if: env.RUNNING && matrix.node == '14' package: name: Publish Package @@ -139,6 +120,11 @@ jobs: NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - uses: actions/checkout@v2 if: env.RUNNING + - name: Check package version + uses: technote-space/package-version-check-action@v1 + with: + COMMIT_DISABLED: 1 + if: env.RUNNING - name: Set running flag run: npx can-npm-publish || echo "RUNNING=" >> $GITHUB_ENV if: env.RUNNING && matrix.target == 'npm' @@ -154,34 +140,19 @@ jobs: if: env.RUNNING && matrix.target == 'gpr' - name: Setup Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: 12 + node-version: 14 registry-url: https://registry.npmjs.org/ + cache: yarn if: env.RUNNING && matrix.target == 'npm' - name: Setup Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: 12 + node-version: 14 registry-url: https://npm.pkg.github.com + cache: yarn if: env.RUNNING && matrix.target == 'gpr' - - name: Get Yarn Cache Directory - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - if: env.RUNNING - - name: Cache node dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - if: env.RUNNING - - name: Check package version - uses: technote-space/package-version-check-action@v1 - with: - COMMIT_DISABLED: 1 - if: env.RUNNING - name: Install Package dependencies run: yarn install if: env.RUNNING @@ -235,7 +206,7 @@ jobs: timeout-minutes: 3 if: always() steps: - - uses: technote-space/workflow-conclusion-action@v1 + - uses: technote-space/workflow-conclusion-action@v2 - uses: 8398a7/action-slack@v3 with: status: failure diff --git a/.github/workflows/issue-opened.yml b/.github/workflows/issue-opened.yml index 0066fe5..ed7ef6d 100644 --- a/.github/workflows/issue-opened.yml +++ b/.github/workflows/issue-opened.yml @@ -12,7 +12,8 @@ jobs: steps: - uses: technote-space/load-config-action@v1 with: - CONFIG_FILENAME: workflow-settings.json + CONFIG_FILENAME: workflow-settings.json, workflow-details.json + IGNORE_WARNING: 'true' - uses: technote-space/create-project-card-action@v1 with: PROJECT: ${{ env.PROJECT }} diff --git a/.github/workflows/pr-opened.yml b/.github/workflows/pr-opened.yml index a625137..fb0b5b8 100644 --- a/.github/workflows/pr-opened.yml +++ b/.github/workflows/pr-opened.yml @@ -12,7 +12,8 @@ jobs: steps: - uses: technote-space/load-config-action@v1 with: - CONFIG_FILENAME: workflow-settings.json + CONFIG_FILENAME: workflow-settings.json, workflow-details.json + IGNORE_WARNING: 'true' - uses: technote-space/create-project-card-action@v1 with: PROJECT: ${{ env.PROJECT }} diff --git a/.github/workflows/pr-updated.yml b/.github/workflows/pr-updated.yml index 552c6f4..8f2bdc9 100644 --- a/.github/workflows/pr-updated.yml +++ b/.github/workflows/pr-updated.yml @@ -1,5 +1,8 @@ on: pull_request_target +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + name: Pull Request updated jobs: @@ -21,13 +24,15 @@ jobs: steps: - uses: technote-space/load-config-action@v1 with: - CONFIG_FILENAME: workflow-settings.json + CONFIG_FILENAME: workflow-settings.json, workflow-details.json + IGNORE_WARNING: 'true' - uses: technote-space/pr-commit-body-action@v1 with: EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }} TITLE: ${{ env.PR_BODY_TITLE }} LINK_ISSUE_KEYWORD: ${{ (startsWith(github.head_ref, 'release/') && 'closes') || '' }} FILTER_PR: true + CHANGE_TEMPLATE: ${{ env.CHANGE_TEMPLATE }} manageRelease: name: Manage release @@ -37,7 +42,8 @@ jobs: steps: - uses: technote-space/load-config-action@v1 with: - CONFIG_FILENAME: workflow-settings.json + CONFIG_FILENAME: workflow-settings.json, workflow-details.json + IGNORE_WARNING: 'true' - uses: technote-space/release-type-action@v1 with: EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }} @@ -51,7 +57,8 @@ jobs: steps: - uses: technote-space/load-config-action@v1 with: - CONFIG_FILENAME: workflow-settings.json + CONFIG_FILENAME: workflow-settings.json, workflow-details.json + IGNORE_WARNING: 'true' - name: Set running flag run: echo "RUNNING=1" >> $GITHUB_ENV - uses: actions/checkout@v2 diff --git a/.github/workflows/toc.yml b/.github/workflows/toc.yml index 27f0afa..6b85b1c 100644 --- a/.github/workflows/toc.yml +++ b/.github/workflows/toc.yml @@ -2,6 +2,9 @@ on: pull_request: types: [opened, synchronize, reopened, closed] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + name: TOC Generator jobs: @@ -13,11 +16,15 @@ jobs: steps: - uses: technote-space/load-config-action@v1 with: - CONFIG_FILENAME: workflow-settings.json - - uses: technote-space/toc-generator@v2 + CONFIG_FILENAME: workflow-settings.json, workflow-details.json + IGNORE_WARNING: 'true' + - uses: technote-space/toc-generator@v4 with: GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} TARGET_BRANCH_PREFIX: ${{ env.BRANCH_PREFIX }} FOLDING: ${{ env.TOC_FOLDING }} MAX_HEADER_LEVEL: ${{ env.TOC_MAX_HEADER_LEVEL }} TOC_TITLE: ${{ env.TOC_TITLE }} + CREATE_PR: ${{ env.TOC_CREATE_PR }} + TARGET_PATHS: ${{ env.TOC_TARGET_PATHS }} + FOOTER: ${{ env.TOC_FOOTER }} diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index 8669191..8bafff2 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -1,12 +1,15 @@ on: schedule: - - cron: 0 9 * * 0 + - cron: 59 23 * * 4 pull_request: types: [opened, reopened, closed] repository_dispatch: types: [update-deps] workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + name: Update dependencies jobs: update: @@ -22,11 +25,8 @@ jobs: - uses: technote-space/load-config-action@v1 if: env.RUNNING1 with: - CONFIG_FILENAME: workflow-settings.json - - uses: technote-space/auto-cancel-redundant-workflow@v1 - if: env.RUNNING1 - with: - EXCLUDE_MERGED: 'true' + CONFIG_FILENAME: workflow-settings.json, workflow-details.json + IGNORE_WARNING: 'true' - name: Update dependencies if: env.RUNNING1 id: update_deps