Commit 98efc9d 1 parent d4994c1 commit 98efc9d Copy full SHA for 98efc9d
File tree 3 files changed +82
-0
lines changed
3 files changed +82
-0
lines changed Original file line number Diff line number Diff line change 7
7
description : Regex of submodule paths to update to HEAD before building.
8
8
default : content-modules
9
9
type : string
10
+ workflow_call :
11
+ inputs :
12
+ submodule_path_regex :
13
+ type : string
14
+ required : true
10
15
11
16
jobs :
12
17
build-and-test :
Original file line number Diff line number Diff line change
1
+ name : Build Semantic Conventions (daily)
2
+
3
+ on :
4
+ schedule :
5
+ # daily at 10:24 UTC
6
+ - cron : " 24 10 * * *"
7
+ workflow_dispatch :
8
+
9
+ jobs :
10
+ build-dev :
11
+ uses : ./.github/workflows/build-dev.yml
12
+ with :
13
+ submodule_path_regex : semantic-conventions
14
+
15
+ workflow-notification :
16
+ needs :
17
+ - build-dev
18
+ if : always()
19
+ uses : ./.github/workflows/reusable-workflow-notification.yml
20
+ with :
21
+ success : ${{ needs.build-dev.result == 'success' }}
22
+ repo : open-telemetry/semantic-conventions
Original file line number Diff line number Diff line change
1
+ # this is useful because notifications for scheduled workflows are only sent to the user who
2
+ # initially created the given workflow
3
+ name : Reusable - Workflow notification
4
+
5
+ on :
6
+ workflow_call :
7
+ inputs :
8
+ success :
9
+ type : boolean
10
+ required : true
11
+ repo :
12
+ type : string
13
+ required : false
14
+
15
+ jobs :
16
+ workflow-notification :
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - uses : actions/checkout@v4
20
+
21
+ - name : Open issue or add comment if issue already open
22
+ env :
23
+ # need to use opentelemetrybot for opening issues in other repos
24
+ GH_TOKEN : ${{ inputs.repo && secrets.OPENTELEMETRYBOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
25
+ run : |
26
+ if [ -z "${{ inputs.repo }}" ]; then
27
+ repo="$GITHUB_REPOSITORY"
28
+ title="Workflow failed: $GITHUB_WORKFLOW"
29
+ body="See [$GITHUB_WORKFLOW #$GITHUB_RUN_NUMBER](https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)."
30
+ else
31
+ repo="${{ inputs.repo }}"
32
+ title="Workflow failed: $GITHUB_REPOSITORY $GITHUB_WORKFLOW"
33
+ body="See [$GITHUB_REPOSITORY $GITHUB_WORKFLOW #$GITHUB_RUN_NUMBER](https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)."
34
+ fi
35
+
36
+ # TODO (trask) search doesn't support exact phrases, so it's possible that this could grab the wrong issue
37
+ number=$(gh issue list --repo $repo --search "in:title $title" --limit 1 --json number -q .[].number)
38
+
39
+ echo $number
40
+ echo ${{ inputs.success }}
41
+
42
+ if [[ $number ]]; then
43
+ if [[ "${{ inputs.success }}" == "true" ]]; then
44
+ gh issue close $number \
45
+ --repo $repo
46
+ else
47
+ gh issue comment $number \
48
+ --repo $repo \
49
+ --body "$body"
50
+ fi
51
+ elif [[ "${{ inputs.success }}" == "false" ]]; then
52
+ gh issue create --repo $repo \
53
+ --title "$title (#$GITHUB_RUN_NUMBER)" \
54
+ --body "$body"
55
+ fi
You can’t perform that action at this time.
0 commit comments