Skip to content

Commit

Permalink
Support pull request target (#113)
Browse files Browse the repository at this point in the history
* bump dev dependencies

* add support for `pull_request_target`

* 1.1.44

* changelog
  • Loading branch information
MishaKav authored Jan 31, 2023
1 parent 506b8a2 commit 19b7ba6
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 23 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog of the Pytest Coverage Comment

## [Pytest Coverage Comment 1.1.44](https://github.com/MishaKav/pytest-coverage-comment/tree/v1.1.44)

**Release Date:** 2023-01-31

#### Changes

- Support `pull_request_target` event to add comments
- Bump dev dependencies

## [Pytest Coverage Comment 1.1.43](https://github.com/MishaKav/pytest-coverage-comment/tree/v1.1.43)

**Release Date:** 2023-01-23
Expand Down
7 changes: 5 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17985,7 +17985,10 @@ const main = async () => {
commit_sha: options.commit,
body,
});
} else if (eventName === 'pull_request') {
} else if (
eventName === 'pull_request' ||
eventName === 'pull_request_target'
) {
if (createNewComment) {
core.info('Creating a new comment');

Expand Down Expand Up @@ -18026,7 +18029,7 @@ const main = async () => {
} else {
if (!options.hideComment) {
// prettier-ignore
core.warning(`This action supports comments only on \`pull_request\` and \`push\` events. \`${eventName}\` events are not supported.\nYou can use the output of the action.`)
core.warning(`This action supports comments only on \`pull_request\`, \`pull_request_target\` and \`push\` events. \`${eventName}\` events are not supported.\nYou can use the output of the action.`)
}
}
};
Expand Down
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pytest-coverage-comment",
"version": "1.1.43",
"version": "1.1.44",
"description": "Comments a pull request with the pytest code coverage badge, full report and tests summary",
"author": "Misha Kav",
"license": "MIT",
Expand Down Expand Up @@ -32,8 +32,8 @@
"xml2js": "^0.4.23"
},
"devDependencies": {
"@vercel/ncc": "^0.36.0",
"eslint": "^8.32.0",
"@vercel/ncc": "^0.36.1",
"eslint": "^8.33.0",
"prettier": "^2.8.3"
},
"prettier": {
Expand Down
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ const main = async () => {
commit_sha: options.commit,
body,
});
} else if (eventName === 'pull_request') {
} else if (
eventName === 'pull_request' ||
eventName === 'pull_request_target'
) {
if (createNewComment) {
core.info('Creating a new comment');

Expand Down Expand Up @@ -236,7 +239,7 @@ const main = async () => {
} else {
if (!options.hideComment) {
// prettier-ignore
core.warning(`This action supports comments only on \`pull_request\` and \`push\` events. \`${eventName}\` events are not supported.\nYou can use the output of the action.`)
core.warning(`This action supports comments only on \`pull_request\`, \`pull_request_target\` and \`push\` events. \`${eventName}\` events are not supported.\nYou can use the output of the action.`)
}
}
};
Expand Down

0 comments on commit 19b7ba6

Please sign in to comment.