diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1ed815c..0c55e7d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,10 +11,24 @@ on: jobs: release: runs-on: ubuntu-latest + permissions: + contents: write + issues: write + pull-requests: write + id-token: write # required for npm Trusted Publishing (OIDC) steps: - name: Checkout uses: actions/checkout@v6 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + registry-url: 'https://registry.npmjs.org' + + - name: Ensure npm supports Trusted Publishing + run: npm install -g npm@latest + - name: Install dependencies run: | npm ci @@ -58,7 +72,9 @@ jobs: uses: cycjimmy/semantic-release-action@v6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + # NPM_TOKEN no longer required: package is published via npm + # Trusted Publishing (OIDC). The id-token: write permission above + # allows npm CLI to authenticate to the registry automatically. - name: SAS Packages Release run: |