Skip to content

Commit 3ac9068

Browse files
authored
build: guard against binary download failures
PR-URL: #13999 Reviewed-by: Athan Reines <kgryte@gmail.com> Closes: stdlib-js/metr-issue-tracker#869
1 parent c8e719a commit 3ac9068

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎.github/workflows/lint_random_files.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ jobs:
206206
id: lint-editorconfig
207207
env:
208208
FILES: ${{ steps.random-files.outputs.files }}
209+
210+
# Provide a token so that the editorconfig-checker binary download is authenticated, thus avoiding rate limiting:
211+
GITHUB_TOKEN: ${{ github.token }}
209212
run: |
210213
set -o pipefail
211214
files=$(echo "$FILES" | tr ',' ' ')
@@ -217,6 +220,12 @@ jobs:
217220
env:
218221
GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
219222
run: |
223+
# Guard against creating spurious issues when the lint step failed due to an infrastructure error (e.g., failing to download the editorconfig-checker binary due to rate limiting) rather than actual lint errors:
224+
if grep -q 'Failed to download binary' lint_editorconfig_errors.txt 2>/dev/null; then
225+
echo 'EditorConfig lint step failed due to an infrastructure error (e.g., failed binary download). Skipping issue creation.'
226+
exit 0
227+
fi
228+
220229
strip_ansi() {
221230
sed -r 's/\x1B\[[0-9;]*[mK]//g'
222231
}

0 commit comments

Comments
 (0)