Action fails to upload when using pull_request_target on GitHub
See original GitHub issueThe addition of pull_request_target
events allows PRs from forked repos coming into the head repo to utilize some functions that pull_request
alone cannot do if PR is coming from a forked repo.
With that in mind the action always fail because GITHUB_REF
is the PR Base Branch path (refs/heads/branch name
). Is there a way this can be fixed through actions to detect the PR number that actions is running that will also allow usage of pull_request_target?
For the time being I am manually using the bash uploader but manually parsing through the event and extracting the PR number, which I then force the uploader to use it via -P
. While this works, there’s nothing shown on that Pull Request from CodeCov unfortunately.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:18 (5 by maintainers)
Top Results From Across the Web
Github actions workflow doesn't run on pull request when pull ...
Along with a solution solution: Conversely, workflows with the pull_request_target event will run even if the pull request has a merge conflict.
Read more >Why doesn't my GitHub Action run automatically from a fork ...
GitHub Actions and Pull Requests with Bdougie#30minutestomergeA quick tour of specific GitHub Actions triggers and their use, plus a deep ...
Read more >GitHub Actions Security Best Practices [cheat sheet included]
Harden your Action runners (and don't use self-hosted runners for public repositories!) Be extra careful with the pull_request_target trigger ...
Read more >Github Actions and the threat of malicious pull requests
What this means is, the pull_request_target event does not use anything from the fork PR at all when executing the workflow configured against ......
Read more >Github Actions POST upload 404 - Codecov
Description Uploads from public repository on Github using Github Actions shows: [2022-07-25T18:41:14.578Z] ['error'] There was an error ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Hashnode Post
No results found
Took a bit of trial and error, but this step seems to work:
I think I still need the workaround, I just don’t need the
fetch-depth
. Doing this worked for me: