mirror of
https://github.com/sasjs/adapter.git
synced 2026-07-23 22:55:28 +00:00
chore: using github app to bypass branch protection
This commit is contained in:
@@ -13,21 +13,37 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
id-token: write
|
id-token: write # required for npm provenance (trusted publisher)
|
||||||
|
issues: write # optional: lets @semantic-release/github comment on issues
|
||||||
|
pull-requests: write # optional: lets @semantic-release/github comment on PRs
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [22]
|
node-version: [22]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
# 1. Mint a short-lived GitHub App token (bypass-capable)
|
||||||
|
- name: Generate token
|
||||||
|
id: app-token
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.APP_ID }}
|
||||||
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
# 2. Checkout using the app token so the release commit can be pushed
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
persist-credentials: true
|
||||||
|
fetch-depth: 0 # semantic-release needs full history + tags
|
||||||
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
registry-url: https://registry.npmjs.org
|
registry-url: https://registry.npmjs.org
|
||||||
|
|
||||||
# 2. Restore npm cache manually
|
# 3. Restore npm cache manually
|
||||||
- name: Restore npm cache
|
- name: Restore npm cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
id: npm-cache
|
id: npm-cache
|
||||||
@@ -52,7 +68,7 @@ jobs:
|
|||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
run: npx semantic-release
|
run: npx semantic-release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} # <-- app token, not secrets.GITHUB_TOKEN
|
||||||
|
|
||||||
- name: Publish to npm with trusted publisher
|
- name: Publish to npm with trusted publisher
|
||||||
if: success()
|
if: success()
|
||||||
|
|||||||
Reference in New Issue
Block a user