Skip to content

Commit dae1fb9

Browse files
committed
fix: make screenshot upload optional when IMGBB_API_KEY is unavailable (for forks)
1 parent e2c1c80 commit dae1fb9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/actions/post-maestro-screenshot/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inputs:
1414
default: 'unknown'
1515
imgbb-api-key:
1616
description: 'ImgBB API key for image hosting'
17-
required: true
17+
required: false
1818

1919
runs:
2020
using: 'composite'
@@ -69,7 +69,7 @@ runs:
6969
fi
7070
7171
- name: Upload screenshot to ImgBB
72-
if: steps.check-screenshot.outputs.exists == 'true' && github.event_name == 'pull_request'
72+
if: steps.check-screenshot.outputs.exists == 'true' && github.event_name == 'pull_request' && inputs.imgbb-api-key != ''
7373
id: upload-screenshot
7474
uses: McCzarny/[email protected]
7575
with:
@@ -82,13 +82,15 @@ runs:
8282
uses: peter-evans/find-comment@v3
8383
id: find-comment
8484
if: github.event_name == 'pull_request'
85+
continue-on-error: true
8586
with:
8687
issue-number: ${{ github.event.pull_request.number }}
8788
comment-author: 'github-actions[bot]'
8889
body-includes: End-to-End Test Results - ${{ inputs.platform == 'ios' && 'iOS' || 'Android' }}
8990

9091
- name: Create or update PR comment (with screenshot)
9192
if: github.event_name == 'pull_request' && steps.check-screenshot.outputs.exists == 'true' && steps.upload-screenshot.outputs.url
93+
continue-on-error: true
9294
uses: peter-evans/create-or-update-comment@v4
9395
with:
9496
token: ${{ inputs.github-token }}
@@ -113,6 +115,7 @@ runs:
113115

114116
- name: Create or update PR comment (no screenshot)
115117
if: github.event_name == 'pull_request' && steps.check-screenshot.outputs.exists != 'true'
118+
continue-on-error: true
116119
uses: peter-evans/create-or-update-comment@v4
117120
with:
118121
token: ${{ inputs.github-token }}
@@ -135,6 +138,7 @@ runs:
135138

136139
- name: Create or update PR comment (upload failed)
137140
if: github.event_name == 'pull_request' && steps.check-screenshot.outputs.exists == 'true' && !steps.upload-screenshot.outputs.url
141+
continue-on-error: true
138142
uses: peter-evans/create-or-update-comment@v4
139143
with:
140144
token: ${{ inputs.github-token }}

0 commit comments

Comments
 (0)