diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 905a6c200..36570b329 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,14 +20,16 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - - uses: actions/setup-python@v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version-file: '.python-version' - name: Cache pip - uses: actions/cache@v5 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} @@ -56,7 +58,9 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - name: Install platform dependencies run: | @@ -72,12 +76,12 @@ jobs: wget https://github.com/jgm/pandoc/releases/download/2.17.1.1/pandoc-2.17.1.1-1-amd64.deb sudo dpkg -i pandoc-2.17.1.1-1-amd64.deb - - uses: actions/setup-python@v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version-file: '.python-version' - name: Cache pip - uses: actions/cache@v5 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 68c6f22a9..21091ac00 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,12 +13,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: persist-credentials: false - - uses: actions/setup-python@v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version: "3.x" - - uses: j178/prek-action@v2 + - uses: j178/prek-action@bdca6f102f98e2b4c7029491a53dfd366469e33d # v2 diff --git a/.github/workflows/purge-cache.yml b/.github/workflows/purge-cache.yml index f7f85c2d4..dc6600842 100644 --- a/.github/workflows/purge-cache.yml +++ b/.github/workflows/purge-cache.yml @@ -19,10 +19,11 @@ jobs: purge: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 if: github.event_name == 'push' with: fetch-depth: 0 + persist-credentials: false - name: Resolve keys id: keys @@ -36,8 +37,10 @@ jobs: fi - name: Purge ${{ steps.keys.outputs.keys || 'pydotorg-app' }} + env: + PURGE_KEYS: ${{ steps.keys.outputs.keys || 'pydotorg-app' }} run: | - for KEY in ${{ steps.keys.outputs.keys || 'pydotorg-app' }}; do + for KEY in ${PURGE_KEYS}; do curl -fsS -X POST \ "https://api.fastly.com/service/${{ secrets.FASTLY_SERVICE_ID }}/purge/$KEY" \ -H "Fastly-Key: ${{ secrets.FASTLY_API_KEY }}" diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index edb234a97..45e0a28f9 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -10,13 +10,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v6 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - - uses: actions/setup-python@v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version-file: '.python-version' - name: Cache Python dependencies - uses: actions/cache@v5 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 env: cache-name: pythondotorg-cache-pip with: diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 000000000..d66032fec --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,25 @@ + +name: GitHub Actions Security Analysis with zizmor 🌈 + +on: + push: + branches: ["main"] + pull_request: + branches: ["**"] + +permissions: {} + +jobs: + zizmor: + name: Run zizmor 🌈 + runs-on: ubuntu-latest + permissions: + security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files. + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Run zizmor 🌈 + uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6