File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 19
19
repository : open-telemetry/opentelemetry-collector
20
20
- name : Update to latest opentelemetry-collector release and create a PR
21
21
run : |
22
+ exec > >(tee log.out) 2>&1
22
23
cd opentelemetry-collector-contrib
23
24
git config user.name opentelemetrybot
24
25
git config user.email [email protected]
30
31
gh pr create --base main --title "[chore] Update core dependencies" --body "This PR updates the opentelemetry-collector dependency to the latest release"
31
32
env :
32
33
GITHUB_TOKEN : ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
34
+ - name : File an issue if the workflow failed
35
+ if : failure()
36
+ run : |
37
+ template=$(cat <<'END'
38
+ [Link to job log](%s)
39
+
40
+ <details>
41
+ <summary>Last 100 lines of log</summary>
42
+
43
+ ```
44
+ %s
45
+ ```
46
+ </details>
47
+ END
48
+ )
49
+ job_url="$(gh run view ${{ github.run_id }} -R ${{ github.repository }} --json jobs -q '.jobs[] | select(.name == "update-otel") | .url')"
50
+ body="$(printf "$template" "$job_url" "$(tail -n100 log.out | tail -c63K)")"
51
+ gh issue create -R ${{ github.repository }} -t 'update-otel workflow failed' -b "$body" -l 'ci-cd'
52
+ env :
53
+ GH_TOKEN : ${{ github.token }}
You can’t perform that action at this time.
0 commit comments