diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a62e31c..4f0f2b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,19 +6,33 @@ on: - "main" pull_request: {} +permissions: + contents: read + jobs: checks: name: Pre-merge Checks runs-on: ubuntu-latest steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 20 + - name: Configure Socket Firewall + uses: workos/setup-socket-firewall@ca93dd8aa351f54f4729fe3377a9be23c631c25d # v1 + with: + token: ${{ secrets.PUBLIC_SOCKET_FIREWALL_TOKEN }} + allow-external-fork-fallback: true + - name: Setup run: npm ci + - name: Remove Socket Firewall credentials before executing source + uses: workos/setup-socket-firewall/teardown@ca93dd8aa351f54f4729fe3377a9be23c631c25d # v1 + - name: Check formatting run: npm run format:check diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 2a5324f..2515c15 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -35,3 +35,5 @@ jobs: needs: release-please if: ${{ needs.release-please.outputs.release_created == 'true' }} uses: ./.github/workflows/release.yml + secrets: + PUBLIC_SOCKET_FIREWALL_TOKEN: ${{ secrets.PUBLIC_SOCKET_FIREWALL_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01b3549..1724513 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,9 @@ name: Release on: workflow_dispatch: workflow_call: + secrets: + PUBLIC_SOCKET_FIREWALL_TOKEN: + required: true defaults: run: @@ -17,14 +20,24 @@ jobs: id-token: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version: 24 registry-url: "https://registry.npmjs.org" + - name: Configure Socket Firewall + uses: workos/setup-socket-firewall@ca93dd8aa351f54f4729fe3377a9be23c631c25d # v1 + with: + token: ${{ secrets.PUBLIC_SOCKET_FIREWALL_TOKEN }} + - name: Install Dependencies run: npm install + - name: Restore public registry before build and publication + uses: workos/setup-socket-firewall/teardown@ca93dd8aa351f54f4729fe3377a9be23c631c25d # v1 + - name: Build project run: npm run build diff --git a/.github/workflows/socket-tier1-analysis.yml b/.github/workflows/socket-tier1-analysis.yml index a983ef8..b639f69 100644 --- a/.github/workflows/socket-tier1-analysis.yml +++ b/.github/workflows/socket-tier1-analysis.yml @@ -16,6 +16,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} cancel-in-progress: true +permissions: + contents: read + jobs: socket-vulnerability-analysis: runs-on: ubuntu-latest @@ -27,8 +30,16 @@ jobs: echo "distinct_id: ${{ github.event.inputs.distinct_id }}" - name: Checkout code uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + - name: Configure Socket Firewall + uses: workos/setup-socket-firewall@ca93dd8aa351f54f4729fe3377a9be23c631c25d # v1 + with: + token: ${{ secrets.PUBLIC_SOCKET_FIREWALL_TOKEN }} - name: Install Socket CLI run: npm install -g socket + - name: Remove Socket Firewall credentials before analysis + uses: workos/setup-socket-firewall/teardown@ca93dd8aa351f54f4729fe3377a9be23c631c25d # v1 - name: Run Tier 1 reachability scan env: SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_API_KEY }}