Always run "Post Screenshot URL" and link to log
This commit is contained in:
1 parent
3ba8f03eea
commit
f84a77c522
1 file changed
+5
-3
@@ -93,7 +93,7 @@ jobs:
|
||||
echo "SCREENSHOT_URL=$SCREENSHOT_URL" >> $GITHUB_ENV || true
|
||||
echo "SCREENSHOT_URL: ${SCREENSHOT_URL}" || true
|
||||
- name: Post Screenshot URL
|
||||
if: github.event_name == 'pull_request'
|
||||
if: ${{ always() && github.event_name == 'pull_request' }}
|
||||
uses: actions/github-script@v4
|
||||
with:
|
||||
script: |
|
||||
@@ -108,12 +108,14 @@ jobs:
|
||||
body: commentBody
|
||||
});
|
||||
} else {
|
||||
const commentBody = "The test was unable to make a screenshot. Most likely the test did not succeed. Please check the logs of the test run, even though it might be green or yellow.";
|
||||
const logURL = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
|
||||
const commentBody = `The test was unable to make a screenshot. Most likely the test did not succeed. Please check the [logs of the test run](${logURL}).`;
|
||||
await github.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: prNumber,
|
||||
body: commentBody
|
||||
});
|
||||
core.setFailed("Unable to post screenshot")
|
||||
core.setFailed("Unable to post screenshot");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user