Skip to content

Commit

Permalink
fix: isPullRequestFromFork returns false for any PR (#1437)
Browse files Browse the repository at this point in the history
* fix: isPullRequestFromFork returns false for any PR

* fix: add log statement

* fix: force set token

* fix: pass in empty string

* fix: bump version

* fix: revert to promise

* fix: revert changes

---------

Co-authored-by: Tom Hu <thomas.hu@sentry.io>
  • Loading branch information
shahar-h and thomasrockhu-codecov authored May 20, 2024
1 parent 59fc46f commit c9dbf6a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
file: ./coverage/coverage-final.json
flags: version,${{ matrix.os }}
name: codecov-version
version: v0.2.0
version: v0.6.0
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
file: ./coverage/coverage-final.json
flags: version,maxos-latest-xlarge
name: codecov-version
version: v0.2.0
version: v0.6.0
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -125,6 +125,6 @@ jobs:
file: ./coverage/coverage-final.json
flags: version,${{ matrix.os }}
name: codecov-version
version: v0.2.0
version: v0.6.0
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32340,7 +32340,8 @@ const getGitService = () => {
return 'github';
};
const isPullRequestFromFork = () => {
if (`${context.eventName}` !== 'pull_request' ||
core.info(`evenName: ${context.eventName}`);
if (`${context.eventName}` !== 'pull_request' &&
`${context.eventName}` !== 'pull_request_target') {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/buildExec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ const getGitService = (): string => {
};

const isPullRequestFromFork = (): boolean => {
core.info(`evenName: ${context.eventName}`);
if (
`${context.eventName}` !== 'pull_request' ||
`${context.eventName}` !== 'pull_request' &&
`${context.eventName}` !== 'pull_request_target'
) {
return false;
Expand Down

0 comments on commit c9dbf6a

Please sign in to comment.