comment-on-pr icon indicating copy to clipboard operation
comment-on-pr copied to clipboard

Multiple commits move HEAD during Github Actions

Open Demmonius opened this issue 4 years ago • 1 comments

Hello, First of all, thank you for this action, it's useful!

I'm running it in my CI but I got an issue here: https://github.com/UnlyEd/next-right-now/runs/474616496 (section "Comment PR (Deployment success)") And got this error: Couldn't find an open pull request for branch with head at 68cd1584010cc948222fb38ea56067020d8eacda. It looks close to #8 but I don't think that's the same problem.

In my case, when I push many commits in a short time, the HEAD is no longer on my initial commit and comment-on-pr can't associate my commit with the HEAD.

Any ideas to solve it? Maybe by adding an environment variable to set ref to use? Something provided Github Actions, like:

      - name: Comment PR
        uses: unsplash/comment-on-pr@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_CI_PR_COMMENT }}
          GITHUB_SHA: ${{ github.sha }}
        with:
          msg: "Commit ${{ github.sha }} deployed"

Where GITHUB_SHA is the commit to use to find the pull request?

Thank you!

Demmonius avatar Mar 06 '20 13:03 Demmonius

@aaronklaassen What do you think about that?

Vadorequest avatar May 19 '20 08:05 Vadorequest