cloudflare / pages-action

MIT License
468 stars 95 forks source link

Map deployment to pull request #39

Closed peschee closed 1 year ago

peschee commented 1 year ago

Hi

Is there a way to "map" / assign a deployment to a pull request?

Given this config:

      - name: Publish to Cloudflare Pages
        uses: cloudflare/pages-action@v1.2.0
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          accountId: xxx
          projectName: yyy
          directory: zzz
          gitHubToken: ${{ secrets.GITHUB_TOKEN }}
        id: publish

We normally get this for our pull requests:

image

It would be nice if the deployment created for this PR would be shown directly in the PR.

WalshyDev commented 1 year ago

What's the rest of your config? This will work if it's being fired but seems like it isn't. I'd check your config and make sure this actually being ran on PRs

peschee commented 1 year ago

@WalshyDev

on:
  pull_request:
  push:
    branches:
      - main
  workflow_dispatch:
stavros-k commented 1 year ago

Also, I'm publishing more than 1 pages within a matrix.

But for me it maps it single environment (pr###/merge).

Maybe map it to (pr##/project_name)?

dhess commented 1 year ago

Based on some recent changes we've made to our GitHub workflows, it seems this also happens if the action is run in a workflow triggered by workflow_run: the action runs and deploys to Cloudflare, but the PR the commit belongs to isn't updated, neither with the deployment notice, nor the nice little comment that this action posts when it's triggered by push.