forked from hashicorp/terraform-provider-azurerm
-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (35 loc) · 1.48 KB
/
add-waiting-response-on-fail.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
name: Add waiting-response on failures
on:
workflow_run:
workflows: ['Check for new usages of deprecated functionality', 'GoLang Linting', 'Website Linting', 'Generation Check', 'Validate Examples', 'Unit Tests', 'Terraform Schema Linting', '32 Bit Build', 'Provider Tests', 'Vendor Dependencies Check']
types: [completed]
permissions:
pull-requests: write
jobs:
add-waiting-response-on-fail:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Get Artifact
id: get_artifact
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0
with:
github_token: ${{secrets.GITHUB_TOKEN}}
run_id: ${{ github.event.workflow_run.id }}
- name: env_vars
id: env_vars
run: |
echo "ghrepo=$(cat artifact/ghrepo.txt)" >>${GITHUB_OUTPUT}
echo "ghowner=$(cat artifact/ghowner.txt)" >>${GITHUB_OUTPUT}
echo "prnumber=$(cat artifact/prnumber.txt)" >>${GITHUB_OUTPUT}
- name: Add waiting-response on fail
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
github.rest.issues.addLabels({
issue_number: ${{ steps.env_vars.outputs.prnumber }},
owner: "${{ steps.env_vars.outputs.ghowner }}",
repo: "${{ steps.env_vars.outputs.ghrepo }}",
labels: ["waiting-response"]
})