Repository navigation
Fix pr-merge workflow, HED detection, add bulk CI deploy - #338
Merged
Merged
Conversation
Use pull_request_target instead of pull_request so the GITHUB_TOKEN has write permissions when PRs come from forks. Fork PRs always get a read-only token with pull_request, causing tag push and release creation to fail with 403.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR338Version: 🤖 Updated on each push. |
Move attacker-controlled github.event expressions from inline run block to env block. With pull_request_target, the workflow has access to AWS secrets, so a malicious fork branch name could inject shell commands.
Allows bulk deployment of CI workflows to all dataset repos. Fetches the dataset list from the API, then deploys to each sequentially with per-repo progress reporting. Usage: nemar admin ci add --all [-y]
detectHedAnnotation only checked events.json under sub-* directories, missing BIDS inheritance files at the root level (e.g. task-flankers_events.json). This caused hedAnnotation=0 on datasets like nm000132 that use root-level HED annotations.
When the version-doi webhook mints a DOI, trigger a background nemar.org sync via waitUntil so version updates appear on the website without manual admin intervention.
- Add console.warn to all empty catch blocks and silent .catch() fallbacks in syncToNemarAfterVersionDoi - Move PR_NUMBER to env block in create-release job - Log when NEMAR credentials are missing (skip reason) - Add warning when --all hits 1000 dataset limit
Node 22 ships with npm that already supports OIDC auth. The npm install -g npm@latest step fails on newer runners due to missing promise-retry module in Node 22.22.2.
The test was hitting the first dataset from the list endpoint, which could be a ds/on-prefix dataset without a GitHub repo. Now filters for nm-prefix datasets and gracefully skips if the collaborators endpoint returns an error (e.g. auth lacks access to that specific repo).
neuromechanist
added a commit
that referenced
this pull request
Apr 17, 2026
Brings to dev from main: - Maintenance mode middleware (#342) - MAINTENANCE_MODE=read-only flip (prod only; dev [env.dev.vars] stays off) - Upload resume fix (#335) - S3 initremote fix on resume (#337) - PR-merge workflow, HED detection, bulk CI deploy (#338) - npm publish fixes (Node 20, npm@11, OIDC) - GitHub Release auto-tag
1 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pull_requesttopull_request_targetin the pr-merge workflow template so theGITHUB_TOKENhas write permissions when PRs come from forks${{ }}expressions (branch ref, PR number) from inlineruntoenvblock to prevent command injection--allflag tonemar admin ci addfor bulk deployment of CI workflows to all dataset reposContext
Failed run: https://github.com/nemarDatasets/nm000132/actions/runs/23919333754
The PR was from a fork (
VisLab/nm000132->nemarDatasets/nm000132). GitHub restricts theGITHUB_TOKENto read-only for fork-originatedpull_requestevents regardless of thepermissionsblock.pull_request_targetruns in the base repo's context with full permissions.Security note
With
pull_request_target,actions/checkout@v4defaults to the base branch (main), not the PR head, so no fork code is executed. The cleanup-staging job'sgithub.event.pull_request.head.ref(attacker-controlled) was moved to theenvblock to prevent shell injection.HED detection bug
detectHedAnnotation()filtered forpath.startsWith("sub-"), missing root-level events.json files that use BIDS inheritance (e.g.task-flankers_events.json). This causedhedAnnotation=0on datasets like nm000132 that define HED at the root level.What was done
backend/src/services/github.tsnemar admin ci add --allfor bulk CI deploymentbackend/src/services/nemar-sync.tsTest plan
bun run build)bun test: 669 pass, 0 fail)nemar admin ci add --help