Comments (4)
Hi @mpdude
Does github.head_ref
work for you? I've not tried it but I would be surprised if that works. The GitHub API is expecting a commit SHA, not a ref.
Even if it works, I think it might be more correct to use github.event.pull_request.head.sha
instead. I know this works because I use it in my CI build. See here
Anyway, it's a good idea to add something to the readme about this. I'll add a section to explain about avoiding the merge commit.
from commit-comment.
I just checked and using head_ref
does work because the API is converting the ref into the "last sha on the ref." There is a small risk that you will hit the wrong commit sha though. If another commit is pushed to the branch before the action runs it will add the comment to the latest commit SHA, not the commit SHA that the Actions run is executing on.
from commit-comment.
I don't think anyone would ever want to add a comment to the merge commit, so I'm now thinking of updating the action to detect that it is running on a pull_request
event and just defaulting the SHA to the pull request branch HEAD.
from commit-comment.
Updated v1
to default sha
to the branch HEAD on pull request events.
from commit-comment.
Related Issues (9)
- accept `body-path` HOT 3
- Option to use an output file HOT 1
- Help request: How to comment on a PR, not the commit HOT 1
- How to comment as github-actions bot? HOT 6
- comment commit with output of something HOT 2
- Getting the following error in my workflow when trying to use this action HOT 1
- Github removed commit comment from the PR timeline HOT 1
- Replace existing commit HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commit-comment.