Skip to content

Phase 4: Migrate dataset-repo workflows off NEMAR_GITHUB_PAT (#432) #439

Closed

Description

@neuromechanist

Scope

Replace `secrets.NEMAR_GITHUB_PAT` in the four dataset-repo workflow templates with `actions/create-github-app-token@v1` to mint a temporary installation token at job start.

Targets (in `backend/src/services/github.ts` workflow templates)

  • `bids-validation.yml`
  • `version-doi.yml`
  • `generate-archive.yml`
  • `pr-merge.yml`

For each, prepend a step:
```yaml

  • uses: actions/create-github-app-token@v1
    id: app-token
    with:
    app-id: ${{ secrets.NEMAR_APP_ID }}
    private-key: ${{ secrets.NEMAR_APP_PRIVATE_KEY }}
    owner: nemarDatasets
    repositories: ${{ github.event.repository.name }}
    ```

Replace every `${{ secrets.NEMAR_GITHUB_PAT }}` reference with `${{ steps.app-token.outputs.token }}` for the duration of that job. Long-lived org secret `NEMAR_GITHUB_PAT` becomes unused.

Rollout

  • Add `NEMAR_APP_ID` + `NEMAR_APP_PRIVATE_KEY` as org-level secrets on `nemarDatasets` (visibility: all).
  • Bump version of the templates so the workflow file has a fresh hash.
  • Refresh CI on all existing dataset repos via `nemar admin ci add` (idempotent thanks to Phase 3: idempotent workflow deploy + sync command #414).

Acceptance

  • A fresh dataset upload (`nm099999` reset + upload) triggers all four workflows with App-token auth and they all succeed.
  • An admin publish-approve cycle on a re-deployed dataset uses App-token auth in CI.
  • `NEMAR_GITHUB_PAT` org secret is no longer referenced in any template.

Part of epic #432. Depends on Phase 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    infrastructure

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions