Skip to content

Commit

Permalink
GHA - Add waiting-response label and comment for failures (#19895)
Browse files Browse the repository at this point in the history
  • Loading branch information
catriona-m authored Jan 9, 2023
1 parent fc7939e commit ed7b09e
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/gradually-deprecated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ name: Check for new usages of deprecated functionality

permissions:
contents: read
pull-requests: write

on:
pull_request:
pull_request_target:
types: ['opened', 'synchronize']
paths:
- '.github/workflows/gradually-deprecated.yaml'
Expand All @@ -22,3 +23,27 @@ jobs:
with:
go-version-file: ./.go-version
- run: ./scripts/run-gradually-deprecated.sh
- name: Add waiting-response on fail
if: failure()
uses: actions-ecosystem/action-add-labels@v1
with:
labels: waiting-response
github_token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ github.event.number }}
repo: ${{ github.event.repository.full_name }}
- name: Get run url
if: failure()
run: |
echo "gha_url=https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" >> $GITHUB_ENV
- name: Send build failure comment
if: failure()
uses: actions/github-script@v6
with:
result-encoding: string
script: |
github.rest.issues.createComment({
issue_number: ${{ github.event.number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: '<b>Build failure</b> \n\n Found new usages of deprecated functionality: \n\n ${{ env.gha_url}}'
})

0 comments on commit ed7b09e

Please sign in to comment.