Skip to content

CICD permissions

CICD permissions #87

Workflow file for this run

name: Deploy to npm
on:
workflow_dispatch:
branches: [main]
push:
branches: [main]
permissions:
id-token: write-all

Check failure on line 10 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / Deploy to npm

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 10, Col: 13): Unexpected value 'write-all' .github/workflows/main.yml (Line: 11, Col: 13): Unexpected value 'write-all'
contents: write-all
jobs:
build:
runs-on: ubuntu-latest
concurrency:
group: lldebugger
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Compile TypeScript
run: npm run build
- name: Build and package extension
working-directory: ./src/extension
run: npm run build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: GitHubActions
- name: Bootstrap CDK
# so I do not have to do it manually when CDK is updated
run: npx cdk bootstrap aws://${{secrets.AWS_ACCOUNT_ID}}/eu-west-1
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
test-cdk-simple:
needs:
- build
runs-on: ubuntu-latest
concurrency:
group: lldebugger
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: GitHubActions
- name: Test
run: npx vitest test/cdk-simple.test.ts
publish:
needs:
- test-cdk-simple
runs-on: ubuntu-latest
concurrency:
group: lldebugger
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Semantic Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}