Skip to content

Commit f3e3bd9

Browse files
authored
Create GitHub issue if tdbuild trigger fails (#2128)
1 parent e49e806 commit f3e3bd9

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/run-td-build.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,25 @@ jobs:
4343
azure-devops-token: '${{ secrets.AZURE_TOUCHDOWN_BUILD_PIPELINE_SECRET }}'
4444
# Only commit updated files back when explicitly requested.
4545
azure-pipeline-variables: "{'commit': ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.commit_strings }} }"
46+
47+
check_failure:
48+
runs-on: ubuntu-latest
49+
needs: runTDBuild
50+
if: failure()
51+
name: Create GitHub issue on failure
52+
steps:
53+
# Failure of this action indicates a problem with our infrastructure.
54+
# Always file a GitHub issue to alert the OCE of the problem.
55+
- name: Create GitHub issue
56+
id: create-issue
57+
run: |
58+
# check for an issue that is already open
59+
curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/search/issues?q=org:Azure+repo:communication-ui-library+label:TDBUILD_FAILURE+state:open > $HOME/tdbuild_issues.json
60+
issue_count=$(jq -r '.total_count' $HOME/tdbuild_issues.json)
61+
if [ $issue_count -gt 0 ]; then
62+
echo "No need to create new issue, one already exists"
63+
else
64+
curl -X POST -H 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/Azure/communication-ui-library/issues -d '{"title":"Action to trigger TD Build failed", "body": "Please investigate failures of https://github.com/Azure/communication-ui-library/actions/workflows/run-td-build.yml", "labels":["TDBUILD_FAILURE"]}'
65+
fi
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)