Skip to content

Commit e99bfd9

Browse files
committed
build: specify FPATs and add early exit step
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 3f3edff commit e99bfd9

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/run_tests_coverage.yml

+17-5
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
id: changed-directories
152152
continue-on-error: true
153153
env:
154-
STDLIB_BOT_GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
154+
STDLIB_BOT_GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_FGPAT_REPO_READ }}
155155
run: |
156156
if [ -n "${{ github.event.pull_request.number }}" ]; then
157157
# Get the list of changed files in pull request:
@@ -185,6 +185,18 @@ jobs:
185185
echo "directories=${{ github.event.inputs.directories }}" >> $GITHUB_OUTPUT
186186
timeout-minutes: 5
187187

188+
# Exit early if non-package directories are changed:
189+
- name: 'Exit early if non-package directories are changed'
190+
if: github.event_name != 'workflow_dispatch'
191+
run: |
192+
directories="${{ steps.changed-directories.outputs.directories }}"
193+
for directory in $directories; do
194+
if [[ "$directory" != "lib/node_modules/@stdlib"* ]]; then
195+
echo "Error: changed directory '$directory' is not in 'lib/node_modules/@stdlib'."
196+
exit 1
197+
fi
198+
done
199+
188200
# Run JavaScript tests:
189201
- name: 'Run JavaScript tests'
190202
id: extract-coverage
@@ -236,7 +248,7 @@ jobs:
236248
# Pin action to full length commit SHA
237249
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
238250
with:
239-
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
251+
github-token: ${{ secrets.STDLIB_BOT_FGPAT_REPO_WRITE }}
240252
script: |
241253
const { data: comments } = await github.rest.issues.listComments({
242254
'issue_number': context.issue.number,
@@ -267,7 +279,7 @@ jobs:
267279
# Pin action to full length commit SHA
268280
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
269281
with:
270-
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
282+
github-token: ${{ secrets.STDLIB_BOT_FGPAT_REPO_WRITE }}
271283
script: |
272284
github.rest.repos.createCommitComment({
273285
'commit_sha': context.sha,
@@ -294,7 +306,7 @@ jobs:
294306
fetch-depth: 1
295307

296308
# Token for accessing the repository:
297-
token: ${{ secrets.REPO_GITHUB_TOKEN }}
309+
token: ${{ secrets.STDLIB_BOT_FGPAT_REPO_READ }}
298310

299311
# Checkout coverage repository branch:
300312
- name: 'Checkout coverage repository branch'
@@ -346,7 +358,7 @@ jobs:
346358
# Commit and push changes:
347359
- name: 'Commit and push changes'
348360
env:
349-
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
361+
REPO_GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_FGPAT_REPO_WRITE }}
350362
USER_NAME: stdlib-bot
351363
run: |
352364
cd ./www-test-code-coverage

0 commit comments

Comments
 (0)