mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 13:36:48 +00:00
8a0bd61fc4
Guard release, publish, wiki-deploy and issue/PR-triage workflows with a `github.repository` check so they no-op in forks instead of failing or acting on the fork's own issues, PRs, tags and registries. Also skip the Docker Scout scan for pull requests from forks: Docker Hub secrets are never exposed there, so the login step could not succeed. Tests and lint stay ungated — they need no secrets and are the gate for incoming fork PRs.
34 lines
889 B
YAML
34 lines
889 B
YAML
name: Publish plugin-sdk to npm
|
|
|
|
# Publishes trek-plugin-sdk when a tag like `plugin-sdk-v1.2.0` is pushed.
|
|
# One-time setup: add an npm automation token as the repo secret NPM_TOKEN.
|
|
# The package's prepublishOnly hook builds + tests before publishing.
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'plugin-sdk-v*'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
publish:
|
|
if: github.repository == 'mauriceboe/TREK'
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: plugin-sdk
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
# 22 matches the TREK server runtime and has node:sqlite, which the
|
|
# dev-server tests exercise.
|
|
node-version: 22
|
|
registry-url: 'https://registry.npmjs.org'
|
|
- run: npm ci
|
|
- run: npm publish
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|