From ab1f28addc9d7f5cadf4ebb79a564046f15bd6cf Mon Sep 17 00:00:00 2001 From: Jan-Olav Eide Date: Thu, 16 Jan 2020 20:32:17 +0100 Subject: [PATCH] Update promote-command.yml Former-commit-id: fb26cdaf29fc2812a8cb98006e34fd488b1870d9 --- .github/workflows/promote-command.yml | 36 ++++++++++++++++----------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/promote-command.yml b/.github/workflows/promote-command.yml index 2cd4541f82..a73165c32d 100644 --- a/.github/workflows/promote-command.yml +++ b/.github/workflows/promote-command.yml @@ -32,25 +32,31 @@ jobs: PRINT_PAYLOAD: true VARS: ${{ env.CLUSTER }}.json - - name: Oppdater kommentar med deployment status ved feil + - name: Oppdater kommentar med deployment status ved feil if: failure() - uses: peter-evans/create-or-update-comment@v1 + uses: actions/github-script@0.4.0 with: - token: ${{ secrets.NOTIFICATION }} - repository: ${{ github.event.client_payload.github.payload.repository.full_name }} - issue-number: ${{ github.event.client_payload.github.payload.issue.number }} - body: | - >promote ${{ github.event.client_payload.slash_command.args }} feilet - reaction-type: -1 + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const issue = { owner: context.issue.owner, + repo: context.issue.repo, + issue_number: ${{ github.event.client_payload.github.payload.issue.number }} } + github.issues.createComment({...issue, + body: '>promote ${{ github.event.client_payload.slash_command.args }} feilet'}) + github.issues.addLabels({...issue, labels: ['deployment','${{ env.CLUSTER }}']}) + - name: Oppdater kommentar med deployment status if: success() - uses: peter-evans/create-or-update-comment@v1 + uses: actions/github-script@0.4.0 with: - token: ${{ secrets.NOTIFICATION }} - repository: ${{ github.event.client_payload.github.payload.repository.full_name }} - issue-number: ${{ github.event.client_payload.github.payload.issue.number }} - body: | - >promote ${{ github.event.client_payload.slash_command.args }} var OK - reaction-type: rocket + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const issue = { owner: context.issue.owner, + repo: context.issue.repo, + issue_number: ${{ github.event.client_payload.github.payload.issue.number }} } + github.issues.createComment({...issue, + body: '>promote ${{ github.event.client_payload.slash_command.args }} var OK'}) + github.issues.addLabels({...issue, labels: ['deployment','${{ env.CLUSTER }}']}) +