diff --git a/.github/workflows/cf-sync.yml b/.github/workflows/cf-sync.yml index 0c3bd260..620e5c0b 100644 --- a/.github/workflows/cf-sync.yml +++ b/.github/workflows/cf-sync.yml @@ -9,6 +9,12 @@ jobs: # Only process comments from the Cloudflare bot on PRs if: github.event.issue.pull_request && github.event.comment.user.login == 'cloudflare-workers-and-pages[bot]' runs-on: ubuntu-latest + # Add workflow permissions to create deployments + permissions: + pull-requests: read + contents: write + deployments: write + steps: - name: Get PR branch id: get-pr @@ -59,6 +65,7 @@ jobs: if: steps.parse-comment.outputs.status == 'starting' || steps.parse-comment.outputs.status == 'finished' uses: actions/github-script@v6 with: + github-token: ${{ secrets.WORKFLOW_PAT || secrets.GITHUB_TOKEN }} script: | const { owner, repo } = context.repo; const prNumber = context.issue.number; @@ -121,6 +128,7 @@ jobs: if: steps.parse-comment.outputs.status == 'finished' uses: actions/github-script@v6 with: + github-token: ${{ secrets.WORKFLOW_PAT || secrets.GITHUB_TOKEN }} script: | const { owner, repo } = context.repo; const prNumber = context.issue.number; diff --git a/.github/workflows/debug-events.yml b/.github/workflows/debug-events.yml new file mode 100644 index 00000000..deed60fe --- /dev/null +++ b/.github/workflows/debug-events.yml @@ -0,0 +1,22 @@ +name: Debug Events + +on: + deployment_status: + +jobs: + debug: + runs-on: ubuntu-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + + - name: Output specific event fields + run: | + echo "Event name: ${{ github.event_name }}" + echo "Deployment state: ${{ github.event.deployment_status.state }}" + echo "Target URL: ${{ github.event.deployment_status.target_url }}" + echo "Environment URL: ${{ github.event.deployment_status.environment_url }}" + echo "Log URL: ${{ github.event.deployment_status.log_url }}" + echo "Environment: ${{ github.event.deployment.environment }}"