Skip to content

auto publish setup

Gar edited this page Mar 28, 2023 · 1 revision

auth token goes in PUBLISH_TOKEN actions secret

main branch needs protections set up as follows:

curl -L \
  -X PUT \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer TOKEN"\
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/npm/{REPO}/branches/main/protection \
  -d '{
  "required_status_checks": null,
  "restrictions": {
    "users": [],
    "teams": ["cli-team"],
    "apps": []
  },
  "enforce_admins": true,
  "required_pull_request_reviews": {
    "dismissal_restrictions": {},
    "dismiss_stale_reviews": true,
    "require_code_owner_reviews": true,
    "required_approving_review_count": 1
  }
}'

Template oss needs to be on latest and have publish turned on

npm pkg set templateOSS.publish=true
Clone this wiki locally