diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7af0a243..fd163c66 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -26,8 +26,8 @@ jobs: checks: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3 with: node-version: "24.x" - name: "Run checks" @@ -59,13 +59,13 @@ jobs: { node: "24.x", weaviate: $WEAVIATE_136 }, ] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3 with: node-version: ${{ matrix.versions.node }} - name: Login to Docker Hub if: ${{ !github.event.pull_request.head.repo.fork && github.triggering_actor != 'dependabot[bot]' }} - uses: docker/login-action@v3 + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4 with: username: ${{secrets.DOCKER_USERNAME}} password: ${{secrets.DOCKER_PASSWORD}} @@ -88,13 +88,13 @@ jobs: matrix: versions: [{ node: "24.x", weaviate: $WEAVIATE_134 }] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3 with: node-version: ${{ matrix.versions.node }} - name: Login to Docker Hub if: ${{ !github.event.pull_request.head.repo.fork && github.triggering_actor != 'dependabot[bot]' }} - uses: docker/login-action@v3 + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4 with: username: ${{secrets.DOCKER_USERNAME}} password: ${{secrets.DOCKER_PASSWORD}} @@ -122,9 +122,9 @@ jobs: pages: write # to deploy to Pages id-token: write # to authenticate with OIDC when publishing to npm steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 # Setup .npmrc file to publish to npm - - uses: actions/setup-node@v3 + - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3 with: node-version: "24.x" registry-url: "https://registry.npmjs.org" @@ -133,13 +133,13 @@ jobs: - run: npm publish - run: npm run docs - name: "Upload docs as pages artifact" - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 with: path: ./docs - name: "Deploy the uploaded pages artifact" - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 - name: "Create a GitHub release" - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 with: generate_release_notes: true draft: true diff --git a/.github/workflows/pr-security-lint.yaml b/.github/workflows/pr-security-lint.yaml new file mode 100644 index 00000000..241f7c58 --- /dev/null +++ b/.github/workflows/pr-security-lint.yaml @@ -0,0 +1,35 @@ +name: PR Security Lint + +# SECURITY: This workflow uses pull_request_target intentionally so that the +# workflow definition runs from the BASE branch (main), not the PR. The +# composite action it invokes lives at a pinned 40-char SHA in +# weaviate/weaviate — attackers cannot alter the lint logic via a PR or by +# tampering with an upstream tag. +# +# Rules: +# 1. Do NOT add `ref: ${{ github.event.pull_request.head.sha }}` or any +# reference to PR-controlled refs. The composite uses the GitHub API to +# fetch the diff text — no PR code is ever executed. +# 2. Do NOT add secrets to this workflow. The pull_request_target context +# grants a token with write access to the base repo and access to all +# repo secrets if any are referenced. We reference none and request +# minimal permissions; keep it that way. +# 3. Keep the composite action pinned to a full-length commit SHA. Tag or +# branch refs would let an upstream change alter the lint logic at +# execution time. +on: + pull_request_target: + +permissions: {} + +jobs: + hidden-unicode: + name: hidden unicode characters + runs-on: ubuntu-latest + permissions: + pull-requests: read # required by the composite's `gh pr diff` call + steps: + - uses: weaviate/weaviate/.github/actions/security-lint@3e52fc80a244f4644d4facc6a4e705ea6eda9039 # PR #11093 + with: + pr-number: ${{ github.event.pull_request.number }} + github-token: ${{ github.token }}