Skip to content

Commit b67a707

Browse files
committed
intermediate comment
Signed-off-by: Paul Spooren <mail@aparcar.org>
1 parent 038287f commit b67a707

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

.github/workflows/build-on-comment.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ jobs:
5151
echo "build_requested=false" >> $GITHUB_OUTPUT
5252
fi
5353
54+
- name: Create early build comment
55+
if: steps.parse-command.outputs.build_requested == 'true'
56+
id: start-comment
57+
uses: peter-evans/create-or-update-comment@v3
58+
with:
59+
issue-number: ${{ github.event.pull_request.number || github.event.issue.number }}
60+
body: |
61+
🚧 **Build in progress for** `${{ steps.parse-command.outputs.build_path }}`...
62+
63+
You can follow progress [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
64+
65+
*Triggered by: @${{ github.event.comment.user.login }}*
66+
5467
- name: Setup build environment
5568
if: steps.parse-command.outputs.build_requested == 'true'
5669
continue-on-error: true
@@ -62,18 +75,15 @@ jobs:
6275
if: steps.parse-command.outputs.build_requested == 'true'
6376
id: build
6477
run: |
65-
# Initialize build system
6678
make defconfig
6779
68-
# Configure build for specific target/subtarget/profile
6980
echo "CONFIG_TARGET_${{ steps.parse-command.outputs.target }}=y" > .config
7081
echo "CONFIG_TARGET_${{ steps.parse-command.outputs.target }}_${{ steps.parse-command.outputs.subtarget }}=y" >> .config
7182
echo "CONFIG_TARGET_${{ steps.parse-command.outputs.target }}_${{ steps.parse-command.outputs.subtarget }}_DEVICE_${{ steps.parse-command.outputs.profile }}=y" >> .config
7283
7384
make defconfig
7485
make -j$(nproc) BUILD_LOG=1
7586
76-
# Check if build succeeded and files exist
7787
if [ -d "bin/" ] && [ "$(ls -A bin/)" ]; then
7888
echo "build_success=true" >> $GITHUB_OUTPUT
7989
else
@@ -100,20 +110,11 @@ jobs:
100110
name: build-${{ steps.parse-command.outputs.target }}-${{ steps.parse-command.outputs.subtarget }}-${{ steps.parse-command.outputs.profile }}
101111
path: build-artifacts.tar.gz
102112

103-
- name: Find existing bot comment
104-
if: steps.build.outputs.build_success == 'true'
105-
id: find-comment
106-
uses: peter-evans/find-comment@v2
107-
with:
108-
issue-number: ${{ github.event.pull_request.number || github.event.issue.number }}
109-
comment-author: "github-actions[bot]"
110-
body-includes: "Build Results for"
111-
112-
- name: Create or update comment with build results
113+
- name: Update comment with build results
113114
if: steps.build.outputs.build_success == 'true'
114115
uses: peter-evans/create-or-update-comment@v3
115116
with:
116-
comment-id: ${{ steps.find-comment.outputs.comment-id }}
117+
comment-id: ${{ steps.start-comment.outputs.comment-id }}
117118
issue-number: ${{ github.event.pull_request.number || github.event.issue.number }}
118119
body: |
119120
## Build Results for `${{ steps.parse-command.outputs.build_path }}`
@@ -129,10 +130,11 @@ jobs:
129130
*Build triggered by: @${{ github.event.comment.user.login }}*
130131
*Last updated: ${{ github.event.comment.created_at }}*
131132
132-
- name: Comment on build failure
133+
- name: Update comment on build failure
133134
if: steps.parse-command.outputs.build_requested == 'true' && steps.build.outputs.build_success == 'false'
134135
uses: peter-evans/create-or-update-comment@v3
135136
with:
137+
comment-id: ${{ steps.start-comment.outputs.comment-id }}
136138
issue-number: ${{ github.event.pull_request.number || github.event.issue.number }}
137139
body: |
138140
## Build Results for `${{ steps.parse-command.outputs.build_path }}`

0 commit comments

Comments
 (0)