From fe2b0a8eb1cca4d69aeeed268071e89cad63925d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=E1=B4=87=CA=80=C9=B4=E1=B4=85=20S=E1=B4=84=CA=9C?= =?UTF-8?q?=E1=B4=8F=CA=80=C9=A2=E1=B4=87=CA=80s?= Date: Sat, 24 Jul 2021 16:20:50 +0200 Subject: [PATCH] ci: Debug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs --- .../metadata-label-pr-ci-status.yaml | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/metadata-label-pr-ci-status.yaml b/.github/workflows/metadata-label-pr-ci-status.yaml index aa7a85b7..9b5ff6e6 100644 --- a/.github/workflows/metadata-label-pr-ci-status.yaml +++ b/.github/workflows/metadata-label-pr-ci-status.yaml @@ -105,12 +105,6 @@ jobs: console.log(result) return result - - name: Get result - run: | - echo "${{steps.get-workflow-jobs.outputs.result}}" - echo "" - echo "${{steps.get-workflow-jobs.outputs.result.lint}}" - # # CI Passed # - name: "add label: ok" # uses: actions-ecosystem/action-add-labels@v1 @@ -128,19 +122,25 @@ jobs: # number: ${{ needs.get-info.outputs.pullRequestNumber }} # labels: "lint:failed" - # # CI Failed - # - name: "add label: failed" - # uses: actions-ecosystem/action-add-labels@v1 - # if: ${{ github.event.workflow_run.conclusion == 'failure' }} - # with: - # github_token: ${{ steps.get-app-token.outputs.token }} - # number: ${{ needs.get-info.outputs.pullRequestNumber }} - # labels: "lint:failed" - - # - name: "remove label: ok" - # uses: actions-ecosystem/action-remove-labels@v1 - # if: ${{ github.event.workflow_run.conclusion == 'failure' }} - # with: - # github_token: ${{ steps.get-app-token.outputs.token }} - # number: ${{ needs.get-info.outputs.pullRequestNumber }} - # labels: "lint:ok" + - name: "Lint failed" + uses: actions/github-script@v4 + if: ${{ fromJSON(steps.get-workflow-jobs.outputs.result).lint == 'failure' }} + env: + LABEL_OK: "lint:ok" + LABEL_FAILED: "lint:failed" + with: + github-token: ${{ steps.get-app-token.outputs.token }} + script: | + const { LABEL_OK, LABEL_FAILED } = process.env + github.issues.addLabels({ + issue_number: context.needs.get-info.outputs.pullRequestNumber, + owner: context.repo.owner, + repo: context.repo.repo, + labels: [LABEL_FAILED] + }) + github.issues.removeLabel({ + issue_number: context.needs.get-info.outputs.pullRequestNumber, + owner: context.repo.owner, + repo: context.repo.repo, + name: [LABEL_OK] + })