Publish with GitHub Actions
Use a GitHub repository identity to publish without storing a registry credential.
1. Trust the release repository
- Open the destination project's CI / OIDC settings.
- Choose GitHub Actions and add the exact
owner/repository. Add the numeric repository or organization ID for stronger rename protection. - Choose Pull & Publish. A pull-only review grant cannot publish.
- Protect the release branch or tag in GitHub. Push access is never issued to pull-request events.
2. Add the workflow
.github/workflows/publish-adversary.yml
name: Publish adversary
on:
push:
tags: ["v*"]
permissions:
contents: read
id-token: write
jobs:
publish:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Publish adversary
uses: doomerlabs/actions/push@v1
with:
path: .
auth-mode: oidc
registry-namespace: your-project-slug
repository-name: security-reviewer
push-latest: trueid-token: writelets the job request a short-lived GitHub OIDC identity; it does not grant repository write access.- The action validates, builds, packages, and pushes the version inferred from the adversary project.
repository-nameis the package name inside the project namespace. Keep it stable across releases.push-latestalso advances the mutable latest tag. Remove it when consumers should use explicit versions only.
Service-account fallback
If OIDC is unavailable, create a dedicated service account with registry:pull and registry:push. Save it as the protected GitHub secret ADVERSARY_PUBLISH_TOKEN and replace the publish step:
.github/workflows/publish-adversary.yml
- name: Publish adversary
uses: doomerlabs/actions/push@v1
with:
path: .
auth-mode: token
token: ${{ secrets.ADVERSARY_PUBLISH_TOKEN }}
registry-namespace: your-project-slug
repository-name: security-reviewer
push-latest: trueDo not expose this token to pull-request jobs. Prefer a GitHub environment with required reviewers when releases need manual approval.