diff --git a/.github/workflows/notify_slack.yml b/.github/workflows/notify_slack.yml index 33002e254..0dddb251e 100644 --- a/.github/workflows/notify_slack.yml +++ b/.github/workflows/notify_slack.yml @@ -12,6 +12,8 @@ on: type: string required: true +permissions: {} + jobs: print_inputs: timeout-minutes: 2 @@ -19,10 +21,14 @@ jobs: runs-on: ubuntu-latest steps: - name: print + env: + RUN_ID: ${{ inputs.run_id }} + WORKFLOW_NAME: ${{ inputs.workflow_name }} + RESULT: ${{ inputs.result }} run: | - echo "${{ inputs.run_id }}" - echo "${{ inputs.workflow_name }}" - echo "${{ inputs.result }}" + echo "$RUN_ID" + echo "$WORKFLOW_NAME" + echo "$RESULT" notify: name: Notify Slack Failure @@ -31,21 +37,32 @@ jobs: if: ${{ inputs.result == 'failure' }} steps: - name: Slack Notification - uses: tokorom/action-slack-incoming-webhook@main env: - INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - with: - text: Scheduled Run Failed - ${{ inputs.workflow_name }} - attachments: | - [ - { - "color": "danger", - "fields": - [ - { - "title": "URL:", - "value": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ inputs.run_id }}" - } + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + WORKFLOW_NAME: ${{ inputs.workflow_name }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ inputs.run_id }} + run: | + payload="$( + jq -n \ + --arg text "Scheduled Run Failed - $WORKFLOW_NAME" \ + --arg run_url "$RUN_URL" \ + '{ + text: $text, + attachments: [ + { + color: "danger", + fields: [ + { + title: "URL:", + value: $run_url + } + ] + } ] - } - ] + }' + )" + + curl --fail --show-error --silent \ + --header "Content-Type: application/json" \ + --data "$payload" \ + "$SLACK_WEBHOOK_URL" diff --git a/.github/workflows/triage-labels.yml b/.github/workflows/triage-labels.yml index cb062caa3..52538ad2f 100644 --- a/.github/workflows/triage-labels.yml +++ b/.github/workflows/triage-labels.yml @@ -10,7 +10,23 @@ jobs: runs-on: ubuntu-latest steps: - name: Update label - uses: andymckay/labeler@master + # actions/github-script v8, checked 2026-04-26. + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd with: - add-labels: "Triage 👀" - remove-labels: "Awaiting Response" + script: | + const { owner, repo } = context.repo; + const issue_number = context.issue.number; + + await github.rest.issues.addLabels({ + owner, + repo, + issue_number, + labels: ["Triage 👀"], + }); + + await github.rest.issues.removeLabel({ + owner, + repo, + issue_number, + name: "Awaiting Response", + });