Skip to content

Commit

Permalink
default action.yml doesnt appear to be working
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamTranquilla committed Apr 19, 2024
1 parent 42322b0 commit 3567a83
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Coverage Upload Action Changelog

## 2.1.1 (April 9, 2024)

- Updated handling for ignoredUsers to always ignore 'dependabot'

## 2.1.0 (April 9, 2024)

- Added optional input ignoredUsers. ignoredUsers is a comma separated string of authors which will not run this action. Defaulted to just 'dependabot'
- Added optional input ignoredUsers. ignoredUsers is a comma separated string of authors which will not run this action

## 2.0.0 (May 18, 2022)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ jobs:
If you have an existing workflow that runs your tests you can just add the `Upload coverage` step at the end of that workflow.

If you want to exclude certain authors from running this action update the ignoreUsers input as seen below
If you want to exclude certain authors from running this action update the ignoreUsers input as seen below. Dependabot is already ignored by default

```
...
with:
coverageEndpoint: https://your.endpoint.here
coverageToken: ${{ secrets.COVERAGE_TOKEN }}
ignoredUsers: 'dependabot,ignoredUser1,ignoredUser2' // <--- Update here
ignoredUsers: 'ignoredUser1,ignoredUser2' // <--- Update here
...
```
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

10 changes: 6 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ const run = async (): Promise<void> => {
.split(',')
.map((user) => user.trim());

if (ignoredUsers.includes(context.payload.pull_request?.user.login)) {
console.log(
`Skipping the action because the pull request is created by ${context.payload.pull_request?.user.login}`
);
console.log(ignoredUsers)

const author = context.payload.pull_request?.user.login;

if (author === 'dependabot' || ignoredUsers.includes(author)) {
console.log(`Skipping the action because the pull request is created by ${author}`);

return;
}
Expand Down

0 comments on commit 3567a83

Please sign in to comment.