Bump ajv from 8.17.1 to 8.18.0 #15
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: Deploy Fork PR Preview | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| pr_number: | |
| description: "PR number to deploy (including forks)" | |
| required: true | |
| pull_request_target: | |
| types: [labeled] | |
| jobs: | |
| deploy-fork: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'workflow_dispatch' || github.event.label.name == 'ok-to-deploy' }} | |
| permissions: | |
| contents: read | |
| deployments: write | |
| pull-requests: write | |
| steps: | |
| # Note: fork PR workflows get a read-only GITHUB_TOKEN even if we request | |
| # pull-requests: write, so we can't post PR comments here. | |
| - name: Fetch PR info | |
| id: pr | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const inputRaw = core.getInput("pr_number") || (context.payload.inputs && context.payload.inputs.pr_number) || ""; | |
| const prNumber = | |
| context.eventName === "workflow_dispatch" | |
| ? Number(inputRaw) | |
| : context.payload.pull_request.number; | |
| if (context.eventName === "workflow_dispatch" && (!prNumber || Number.isNaN(prNumber))) { | |
| core.setFailed(`Missing required input: pr_number (got: "${inputRaw}")`); | |
| return; | |
| } | |
| const { data: pr } = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: prNumber, | |
| }); | |
| const labels = pr.labels.map((l) => l.name); | |
| if (!labels.includes("ok-to-deploy")) { | |
| core.setFailed("Missing required label: ok-to-deploy"); | |
| } | |
| core.setOutput("repo", pr.head.repo.full_name); | |
| core.setOutput("ref", pr.head.ref); | |
| core.setOutput("sha", pr.head.sha); | |
| core.setOutput("number", pr.number); | |
| core.setOutput("is_fork", pr.head.repo.fork ? "true" : "false"); | |
| - name: Checkout PR head | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ steps.pr.outputs.repo }} | |
| ref: ${{ steps.pr.outputs.sha }} | |
| persist-credentials: false | |
| - name: Setup yarn | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ".node-version" | |
| cache: "yarn" | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Sync playground bundles | |
| run: yarn build:sync-bundles | |
| - name: Build | |
| run: yarn build | |
| - name: Deploy | |
| id: deploy | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy out --project-name=rescript-lang-org | |
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
| wranglerVersion: 4.61.1 | |
| continue-on-error: true | |
| env: | |
| FORCE_COLOR: 0 | |
| - name: Comment PR with deployment link | |
| if: ${{ github.event_name != 'workflow_dispatch' }} | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| recreate: true | |
| header: fork-preview-deployment | |
| message: | | |
| ## Fork PR Cloudflare deployment | |
| PR: #${{ steps.pr.outputs.number }} | |
| Deployement ID: ${{ steps.deploy.outputs.pages-deployment-id }} | |
| Deployment Environment: ${{ steps.deploy.outputs.pages-environment }} | |
| ${{ steps.deploy.outputs.command-output }} |