cloudflare / pages-action

MIT License
468 stars 95 forks source link

Comment not showing when deploying from `issue_comment` workflow type #78

Open Gideonnn opened 1 year ago

Gideonnn commented 1 year ago

I moved my workflow from on pull_request to issue_comment to save some build minutes. Deployment works fine, but GitHub does not register the deployment anymore and also I get no comment on the pr anymore.

Anyone know how to fix this?

Included a cleaned up version of the workflow beneath.

Edit: I noticed that deployments do get triggered correctly and are shown in ...repo/desployments, but the pull request page claims it didn't: afbeelding

name: chatops

on:
  issue_comment:
    types: [created]

jobs:
  trigger:
    runs-on: ubuntu-22.04
    steps:
      - name: Trigger
        uses: peter-evans/slash-command-dispatch@v3
        with:
          token: ${{ secrets.CHATOPS_TOKEN }}
          commands: deploy

  deploy:
    runs-on: ubuntu-22.04
    needs: trigger
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '18'
      - run: npm i
      - run: npm run build
      - uses: cloudflare/pages-action@v1
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
          projectName: my-project
          directory: dist
          gitHubToken: ${{ secrets.GITHUB_TOKEN }}
          branch: ${{ github.ref_name }}