Skip to content

Commit 71b7949

Browse files
committed
Make it pretty, and rename
1 parent a7dbce3 commit 71b7949

File tree

3 files changed

+73
-11
lines changed

3 files changed

+73
-11
lines changed

.github/workflows/labeler.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@
1717
# under the License.
1818
#
1919

20-
name: "Pull Request Labeler"
20+
# Intentionally has a general name.
21+
# because the test status check created in GitHub Actions
22+
# currently randomly picks any associated workflow.
23+
# So, the name was changed to make sense in that context too.
24+
# See also https://github.community/t/specify-check-suite-when-creating-a-checkrun/118380/10
25+
26+
name: "On pull requests"
2127
on: pull_request_target
2228

2329
jobs:
2430
label:
31+
name: Label pull requests
2532
runs-on: ubuntu-latest
2633
steps:
2734
# In order to get back the negated matches like in the old config,

.github/workflows/notify_test_workflow.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1-
name: Notify test workflow
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
# Intentionally has a general name.
21+
# because the test status check created in GitHub Actions
22+
# currently randomly picks any associated workflow.
23+
# So, the name was changed to make sense in that context too.
24+
# See also https://github.community/t/specify-check-suite-when-creating-a-checkrun/118380/10
25+
name: On pull request update
226
on:
327
pull_request_target:
428
types: [opened, reopened, synchronize]

.github/workflows/update_build_status.yml

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
name: Update build status
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
name: Update build status workflow
221

322
on:
423
schedule:
@@ -37,14 +56,26 @@ jobs:
3756
if (cr.name == "Build and test") {
3857
const params = JSON.parse(cr.output.text) // text contains parameters to make request in JSON
3958
const run = await github.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}', params)
40-
const response = await github.request('PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}', {
41-
owner: context.repo.owner,
42-
repo: context.repo.repo,
43-
check_run_id: cr.id,
44-
output: cr.output,
45-
status: run.data.status,
46-
conclusion: run.data.conclusion
47-
})
59+
60+
// Keep syncing the status of the checks
61+
if (run.data.status == "completed") {
62+
const response = await github.request('PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}', {
63+
owner: context.repo.owner,
64+
repo: context.repo.repo,
65+
check_run_id: cr.id,
66+
output: cr.output,
67+
status: run.data.status,
68+
conclusion: run.data.conclusion
69+
})
70+
} else {
71+
const response = await github.request('PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}', {
72+
owner: context.repo.owner,
73+
repo: context.repo.repo,
74+
check_run_id: cr.id,
75+
output: cr.output,
76+
status: run.data.status,
77+
})
78+
}
4879
4980
break
5081
}

0 commit comments

Comments
 (0)