1
0
mirror of https://github.com/arduino/library-registry.git synced 2025-07-07 14:41:10 +03:00

Use a variable to define error message prefix

Whenever the bot needs to communicate to the user about a blocking issue with their pull request that they are able to
resolve, a standardized prefix is added to the situation-specific error message (" **ERROR:**") to draw their
attention to this information. This standardized text occurred multiple times in the workflow, which might lead to it
becoming inconsistent over time, or just more work to improve the text. Use of an environment variable ensures that all
uses of the prefix will be consistent and allows it to be edited once in a single place.
This commit is contained in:
per1234
2021-07-24 02:58:25 -07:00
parent 584918e3db
commit ec4a8a8be1

View File

@ -6,6 +6,7 @@ env:
# GitHub user names to request reviews from in cases where PRs can't be managed automatically.
- per1234
CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT: check-submissions-failed
ERROR_MESSAGE_PREFIX: ":x: **ERROR:** "
on:
# pull_request_target trigger is used instead of pull_request so the token will have the write permissions needed to
@ -205,7 +206,7 @@ jobs:
|
A problem was found with your submission ${{ matrix.submission.submissionURL }}
:x: **ERROR:** ${{ matrix.submission.error }}
${{ env.ERROR_MESSAGE_PREFIX }}${{ matrix.submission.error }}
- name: Set checks result to fail if error detected by submission parser
if: matrix.submission.error != ''
@ -296,7 +297,7 @@ jobs:
issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }}
body: |
|
:x: **ERROR:** [Arduino Lint](https://github.com/arduino/arduino-lint) found errors with ${{ matrix.submission.submissionURL }}:
${{ env.ERROR_MESSAGE_PREFIX }}[Arduino Lint](https://github.com/arduino/arduino-lint) found errors with ${{ matrix.submission.submissionURL }}:
```
${{ steps.read-lint-report.outputs.text-report }}
@ -462,7 +463,7 @@ jobs:
issue_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }}
body: |
|
:x: **ERROR:** Your submission meets all requirements. However, the pull request could not be merged.
${{ env.ERROR_MESSAGE_PREFIX }}Your submission meets all requirements. However, the pull request could not be merged.
Please follow this guide to resolve a merge conflict:
https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-on-github