From 359dc4d713469a6f8d8504ffe5455c155f244802 Mon Sep 17 00:00:00 2001 From: technote-space Date: Thu, 17 Dec 2020 16:27:14 +0000 Subject: [PATCH] chore: sync workflows --- .github/workflow-settings.json | 10 ++++- .github/workflows/add-release-tag.yml | 3 +- .github/workflows/add-test-tag.yml | 3 +- .github/workflows/check-warnings.yml | 46 +++++++++++++++++++++++ .github/workflows/issue-opened.yml | 3 +- .github/workflows/pr-opened.yml | 3 +- .github/workflows/pr-updated.yml | 9 +++-- .github/workflows/toc.yml | 4 +- .github/workflows/update-dependencies.yml | 3 +- 9 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/check-warnings.yml diff --git a/.github/workflow-settings.json b/.github/workflow-settings.json index 739c0c43..0519d0c7 100644 --- a/.github/workflow-settings.json +++ b/.github/workflow-settings.json @@ -14,5 +14,13 @@ "TOC_MAX_HEADER_LEVEL": "3", "TOC_TITLE": "Details", "TOC_CREATE_PR": "true", - "BRANCH_PREFIX": "release/" + "TOC_TARGET_PATHS": "README*.md", + "BRANCH_PREFIX": "release/", + "ANNOTATION_EXCLUDE_PATTERNS": [ + "warning jest", + "warning babel-jest", + "Cloning into", + "has unmet peer dependency", + "has incorrect peer dependency" + ] } diff --git a/.github/workflows/add-release-tag.yml b/.github/workflows/add-release-tag.yml index 04994504..5e5cab1b 100644 --- a/.github/workflows/add-release-tag.yml +++ b/.github/workflows/add-release-tag.yml @@ -17,7 +17,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: diff --git a/.github/workflows/add-test-tag.yml b/.github/workflows/add-test-tag.yml index 7dc44f01..f08ec81d 100644 --- a/.github/workflows/add-test-tag.yml +++ b/.github/workflows/add-test-tag.yml @@ -13,7 +13,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: actions/checkout@v2 - uses: technote-space/get-git-comment-action@v1 - name: Get version diff --git a/.github/workflows/check-warnings.yml b/.github/workflows/check-warnings.yml new file mode 100644 index 00000000..0a342de4 --- /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@v1 + 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/issue-opened.yml b/.github/workflows/issue-opened.yml index 0066fe51..ed7ef6d8 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 a625137b..fb0b5b88 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 552c6f42..b8885b5c 100644 --- a/.github/workflows/pr-updated.yml +++ b/.github/workflows/pr-updated.yml @@ -21,7 +21,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/pr-commit-body-action@v1 with: EXCLUDE_MESSAGES: ${{ env.EXCLUDE_MESSAGES }} @@ -37,7 +38,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 +53,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 083d208c..48623f02 100644 --- a/.github/workflows/toc.yml +++ b/.github/workflows/toc.yml @@ -13,7 +13,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/toc-generator@v3 with: GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} @@ -22,3 +23,4 @@ jobs: 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 }} diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index fc329dda..dd44650e 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -23,7 +23,8 @@ jobs: - uses: technote-space/load-config-action@v1 if: env.RUNNING1 with: - CONFIG_FILENAME: workflow-settings.json + CONFIG_FILENAME: workflow-settings.json, workflow-details.json + IGNORE_WARNING: 'true' - uses: technote-space/auto-cancel-redundant-workflow@v1 if: env.RUNNING1 with: