ci: pin GitHub Actions to SHA digests (fix zizmor unpinned-uses) #65
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Preview | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, closed] | |
| concurrency: | |
| group: preview-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| name: Deploy & Test | |
| if: github.event.action != 'closed' | |
| uses: ./.github/workflows/deploy.yml | |
| with: | |
| worker_name: multistore-proxy-pr-${{ github.event.pull_request.number }} | |
| wrangler_config: wrangler.deploy.toml | |
| environment: preview | |
| oidc_issuer_override: "https://multistore-proxy-pr-${{ github.event.pull_request.number }}.${{ vars.CLOUDFLARE_WORKERS_SUBDOMAIN }}.workers.dev" | |
| secrets: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| SESSION_TOKEN_KEY: ${{ secrets.SESSION_TOKEN_KEY }} | |
| OIDC_PROVIDER_KEY: ${{ secrets.OIDC_PROVIDER_KEY }} | |
| comment: | |
| name: PR Comment | |
| needs: deploy | |
| if: github.event.action != 'closed' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Find Comment | |
| uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4 | |
| id: find-comment | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| comment-author: "github-actions[bot]" | |
| body-includes: Latest commit deployed to | |
| - name: Create or update comment | |
| uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5 | |
| with: | |
| comment-id: ${{ steps.find-comment.outputs.comment-id }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body: | | |
| 🚀 Latest commit deployed to ${{ needs.deploy.outputs.deploy_url }} | |
| * Date: `${{ github.event.pull_request.updated_at }}` | |
| * Commit: ${{ github.sha }} | |
| edit-mode: replace | |
| cleanup: | |
| name: Cleanup Preview | |
| if: github.event.action == 'closed' | |
| runs-on: ubuntu-latest | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| steps: | |
| - name: Delete preview worker | |
| run: npx wrangler delete --name "multistore-proxy-pr-${{ github.event.pull_request.number }}" --force |