Skip to content

Commit 71b2226

Browse files
committed
Automatically triggers CI and comments result
1 parent 011640b commit 71b2226

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

.github/workflows/fatimage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
steps:
5757
- uses: actions/checkout@v3
5858
with:
59-
ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || inputs.target_branch }}
59+
ref: ${{ github.event_name != 'workflow_call' && github.ref || inputs.target_branch }}
6060

6161
- name: Record settings for CI cloud
6262
run: |

.github/workflows/stackhpc.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
name: Test deployment and reimage on OpenStack
33
on:
44
workflow_dispatch:
5+
workflow_call:
6+
inputs:
7+
target_branch:
8+
type: string
9+
default: ${{ github.ref }}
510
push:
611
branches:
712
- main
@@ -44,7 +49,9 @@ jobs:
4449
CI_CLOUD: ${{ vars.CI_CLOUD }} # default from repo settings
4550
TF_VAR_os_version: ${{ matrix.os_version }}
4651
steps:
47-
- uses: actions/checkout@v2
52+
- uses: actions/checkout@v3
53+
with:
54+
ref: ${{ github.event_name != 'workflow_call' && github.ref || inputs.target_branch }}
4855

4956
- name: Override CI_CLOUD if PR label is present
5057
if: ${{ github.event_name == 'pull_request' }}

.github/workflows/update-timestamps.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,27 @@ jobs:
130130
run: gh pr create --title "[Auto] Bump repo timestamps to latest" --base main --head auto/bump-timestamps --body "Updated Release Train timestamps in defaults.yml with latest from Ark"
131131
env:
132132
GH_TOKEN: ${{ github.token }}
133+
134+
run_ci:
135+
needs: bump_timestamps
136+
uses: ./.github/workflows/stackhpc.yml
137+
with:
138+
target_branch: auto/bump-timestamps
139+
140+
comment_result:
141+
if: always() && (needs.run_ci.result == 'failure' || needs.run_ci.result == 'success') && (needs.create_pr.result == 'skipped' || needs.create_pr.result == 'success')
142+
needs:
143+
- run_ci
144+
- create_pr
145+
runs-on: ubuntu-latest
146+
steps:
147+
- name: Checkout branch
148+
uses: actions/checkout@v3
149+
with:
150+
ref: auto/bump-timestamps
151+
152+
- name: Comment CI status
153+
uses: thollander/actions-comment-pull-request@v1
154+
with:
155+
message: 'CI ${{ needs.run_ci.result }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
156+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)