Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the option to ignore specific repos #315

Merged
merged 7 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion dist/weekly-contributions/index.js

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

2 changes: 1 addition & 1 deletion dist/weekly-contributions/index.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/weekly-contributions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type PRStates = IssueStates | 'MERGED'

let loginToNameMap: { [key: string]: string } = {}
let ignoreSummariesLoginArray: string[] = []
let ignoreReposArray: string[] = []

async function main() {
const token = core.getInput('github-token')
Expand All @@ -18,6 +19,9 @@ async function main() {
ignoreSummariesLoginArray =
JSON.parse(core.getInput('ignore-summaries-login-array')) ||
new Array<string>()
ignoreReposArray =
JSON.parse(core.getInput('ignore-repos-array')) ||
new Array<string>()

const octokit = github.getOctokit(token)

Expand All @@ -33,7 +37,7 @@ async function main() {
sort: 'pushed',
per_page: 100
})
const repos = data.map(({ name }) => name).filter(name => !name.startsWith('_'))
const repos = data.map(({ name }) => name).filter(name => !name.startsWith('_') || !ignoreReposArray.includes(name))

interface PRGroupedByAuthor {
[login: string]: {
Expand Down
4 changes: 4 additions & 0 deletions weekly-contributions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
ignore-summaries-login-array:
required: false
description: Ignore summaries for these GitHub logins
ignore-repos-array:
required: false
description: Ignore specific repos when generating the report
default: '[]'
outputs:
markdown:
description: Output summary
Expand Down
Loading
Loading