File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 99 distribution :
1010 required : true
1111 type : string
12+ issue-on-failure :
13+ required : false
14+ type : boolean
15+ default : false
16+ description : " Set to true if a GH issue should be generated upon failure"
1217
1318jobs :
1419 package-tests :
2833
2934 - name : Test ${{ matrix.type }} package
3035 run : ./scripts/package-tests/package-tests.sh ./otelcol*-SNAPSHOT-*_linux_amd64.${{ matrix.type }} ${{ inputs.distribution }}
36+
37+ create-issue :
38+ name : Create GitHub Issue
39+ runs-on : ubuntu-24.04
40+ needs : [package-tests]
41+ if : failure() && inputs.issue-on-failure == 'true'
42+ steps :
43+ - name : Formulate issue
44+ id : formulate_issue
45+ run : |
46+ # create a markdown file that contains details about the failure
47+ echo "The nightly linux package tests failed in the following GitHub actions run." > nightly-test-failure.md
48+ echo "* Link to run: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> nightly-test-failure.md
49+ echo "* Triggered by: Nightly scheduled build" >> nightly-test-failure.md
50+ echo "" >> nightly-test-failure.md
51+ echo "Note: This issue was auto-generated from [base-package-tests.yaml](https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/.github/workflows/base-package-tests.yaml)" >> nightly-test-failure.md
52+
53+ - name : Create issue on failure
54+ env :
55+ GITHUB_TOKEN : ${{ secrets.GH_PAT }}
56+ run : |
57+ gh issue create \
58+ --repo open-telemetry/opentelemetry-collector-contrib \
59+ --title "Nightly Linux Package Tests Failed" \
60+ --body-file nightly-test-failure.md \
61+ --label "release:blocker"
Original file line number Diff line number Diff line change 2222 with :
2323 distribution : otelcol-contrib
2424 type : ' [ "deb", "rpm" ]'
25+ issue-on-failure : true
You can’t perform that action at this time.
0 commit comments