diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a657e5f..553ecfc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,9 @@ on: push: branches: [master] +permissions: + contents: read + jobs: ci: runs-on: ubuntu-latest @@ -26,15 +29,17 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Set up Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: ${{ matrix.node-version }} - name: Install dependencies - run: npm ci + run: npm ci --ignore-scripts - name: All self-tests run: npm test diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 7a266d7..f0343e7 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -24,10 +24,7 @@ on: branches: [master] workflow_dispatch: -permissions: - contents: read - pages: write - id-token: write +permissions: {} concurrency: group: pages @@ -41,17 +38,21 @@ env: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Set up Node.js 20 - uses: actions/setup-node@v4 + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 20 - name: Install dependencies - run: npm ci + run: npm ci --ignore-scripts - name: Fetch excalidraw at pinned SHA run: | @@ -117,17 +118,21 @@ jobs: fi - name: Upload Pages artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 with: path: _site deploy: needs: build runs-on: ubuntu-latest + # Publish credentials live only here: this job runs no project code. + permissions: + pages: write + id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1