Skip to content

Commit 9439952

Browse files
authored
Fix first run of workflow.
1 parent d46fd55 commit 9439952

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

.github/workflows/gradle.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,23 @@ jobs:
2424
issue-number: ${{ github.event.pull_request.number }}
2525
comment-author: 'github-actions[bot]'
2626

27-
- name: Set progress comment
27+
- name: Create progress comment if not exists
2828
uses: peter-evans/create-or-update-comment@v4
29-
if: github.event_name == 'pull_request'
30-
id: update-progress
29+
if: github.event_name == 'pull_request' && steps.find-comment.outputs.comment-id == ''
30+
id: create-comment
31+
with:
32+
issue-number: ${{ github.event.pull_request.number }}
33+
body: |
34+
### 🚧 Build in progress...
35+
36+
> [!NOTE]
37+
> A new commit has been pushed. A development build of **EternalCore** will be available here once the workflow completes.
38+
edit-mode: replace
39+
40+
- name: Update progress comment if exists
41+
uses: peter-evans/create-or-update-comment@v4
42+
if: github.event_name == 'pull_request' && steps.find-comment.outputs.comment-id != ''
43+
id: update-comment
3144
with:
3245
comment-id: ${{ steps.find-comment.outputs.comment-id }}
3346
issue-number: ${{ github.event.pull_request.number }}
@@ -38,6 +51,11 @@ jobs:
3851
> A new commit has been pushed. A development build of **EternalCore** will be available here once the workflow completes.
3952
edit-mode: replace
4053

54+
- name: Set comment-id output
55+
id: comment
56+
run: |
57+
echo "comment-id=${{ steps.find-comment.outputs.comment-id != '' && steps.find-comment.outputs.comment-id || steps.create-comment.outputs.comment-id }}" >> $GITHUB_OUTPUT
58+
4159
- name: Checkout
4260
uses: actions/[email protected]
4361

@@ -74,14 +92,14 @@ jobs:
7492
uses: peter-evans/create-or-update-comment@v4
7593
if: github.event_name == 'pull_request'
7694
with:
77-
comment-id: ${{ steps.find-comment.outputs.comment-id }}
95+
comment-id: ${{ steps.comment.outputs.comment-id }}
7896
body: |
7997
### 📦 Development Build Ready
8098
8199
> [!WARNING]
82100
> **Do not use this build in production.** It is for testing purposes only and may be unstable.
83101
84102
👉 [**Click here to download the JAR**](${{ steps.upload-artifact.outputs.artifact-url }})
85-
103+
86104
edit-mode: replace
87105
reactions: rocket

0 commit comments

Comments
 (0)