From 2b6b20cc56e773e468962349ba00a42923cce93a Mon Sep 17 00:00:00 2001 From: DevForge Engineer Date: Mon, 18 May 2026 13:44:28 -0400 Subject: [PATCH] fix: remove npm-publish.yml, harden CI workflow security - Remove npm-publish.yml (wrong-language workflow for Python repo) - Add permissions: contents: read to ci.yml job - Add persist-credentials: false to checkout steps in ci.yml and pages.yml - Update pages.yml checkout@v4 to @v6 --- .github/workflows/ci.yml | 4 ++++ .github/workflows/npm-publish.yml | 28 ---------------------------- .github/workflows/pages.yml | 4 +++- 3 files changed, 7 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4090b62..d953ec5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,12 +10,16 @@ on: jobs: test: runs-on: ubuntu-latest + permissions: + contents: read strategy: matrix: python-version: ["3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml deleted file mode 100644 index ffc3b66..0000000 --- a/.github/workflows/npm-publish.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Publish to npm - -on: - release: - types: [published] - workflow_dispatch: - -jobs: - publish: - runs-on: ubuntu-latest - permissions: - contents: read - - steps: - - uses: actions/checkout@v6 - - - name: Set up Node.js - uses: actions/setup-node@v6 - with: - node-version: "22" - registry-url: "https://registry.npmjs.org" - - - name: Publish to npm - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - npm publish --access public - diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index d2d8ccb..4259af1 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -18,7 +18,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Setup Pages uses: actions/configure-pages@v5 - name: Build with Jekyll