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 a reminder when contributor is new to ping all contributor bot #2484

Merged
merged 47 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5444909
a
KevinEyo1 Jan 29, 2024
a4a4d72
Revert test changes
KevinEyo1 Jan 29, 2024
ea3aca7
Merge branch 'MarkBind:master' into master
KevinEyo1 Feb 4, 2024
c0f79a2
Merge branch 'MarkBind:master' into master
KevinEyo1 Feb 9, 2024
45b8846
Merge branch 'MarkBind:master' into master
KevinEyo1 Feb 18, 2024
21628f7
Merge branch 'MarkBind:master' into master
KevinEyo1 Feb 28, 2024
969865f
Add how to check if permissions are given
yucheng11122017 Mar 12, 2024
46397e7
Merge branch 'master' of https://github.com/MarkBind/markbind
yucheng11122017 Mar 14, 2024
21fa90c
Merge branch 'master' of https://github.com/KevinEyo1/markbind
KevinEyo1 Mar 15, 2024
0bc66f7
Merge branch 'master' of https://github.com/MarkBind/markbind
yucheng11122017 Mar 17, 2024
0ebb7cd
Merge branch 'MarkBind:master' into master
KevinEyo1 Mar 18, 2024
f798b1d
Merge branch 'master' of https://github.com/MarkBind/markbind
KevinEyo1 Mar 20, 2024
48399bd
Merge branch 'master' of https://github.com/MarkBind/markbind
KevinEyo1 Mar 20, 2024
cb84513
Fix merge conflict
yucheng11122017 Mar 23, 2024
701183b
Merge branch 'master' of https://github.com/MarkBind/markbind
KevinEyo1 Mar 25, 2024
4a83981
Merge branch 'master' of https://github.com/MarkBind/markbind
KevinEyo1 Mar 29, 2024
85d3b9f
Add workflow
KevinEyo1 Mar 29, 2024
7e7cfb7
Merge branch 'master' of https://github.com/MarkBind/markbind
KevinEyo1 Mar 29, 2024
e5619fa
Merge branch 'master' into 2457-ping-new-contrib
KevinEyo1 Mar 29, 2024
2c9e6b4
Fix workflow
KevinEyo1 Mar 31, 2024
de03628
Merge branch 'master' into 2457-ping-new-contrib
KevinEyo1 Mar 31, 2024
15a926b
Update workflow
KevinEyo1 Mar 31, 2024
9a08f81
Merge branch '2457-ping-new-contrib' of https://github.com/KevinEyo1/…
KevinEyo1 Mar 31, 2024
79a6363
Update action
KevinEyo1 Mar 31, 2024
2b43560
Add echo
KevinEyo1 Apr 2, 2024
64c280d
Add log
KevinEyo1 Apr 2, 2024
01a0637
Update workflow
KevinEyo1 Apr 3, 2024
c4e8b52
Merge branch 'master' into 2457-ping-new-contrib
KevinEyo1 Apr 3, 2024
e2f6301
Allocate space for scrollbar in nav components
jingting1412 Apr 5, 2024
eb69423
Fix merge conflict
yucheng11122017 Apr 5, 2024
c9c05c2
Merge branch 'master' into 2457-ping-new-contrib
KevinEyo1 Apr 5, 2024
936dadc
Fix merge conflict
yucheng11122017 Apr 5, 2024
30d31f7
Test time
KevinEyo1 Apr 5, 2024
6056ba5
Merge branch '2457-ping-new-contrib' of https://github.com/KevinEyo1/…
KevinEyo1 Apr 5, 2024
88405dd
Remove logs
KevinEyo1 Apr 5, 2024
cfeffed
Merge branch 'master' into 2457-ping-new-contrib
KevinEyo1 Apr 5, 2024
5b9e7d7
Revert "Fix merge conflict"
yucheng11122017 Apr 5, 2024
c092296
Merge branch 'master' into 2457-ping-new-contrib
KevinEyo1 Apr 5, 2024
30996b3
Merge branch 'master' into 2457-ping-new-contrib
KevinEyo1 Apr 5, 2024
d6324a3
Merge branch 'master' into 2457-ping-new-contrib
KevinEyo1 Apr 7, 2024
7b5d6a9
Update files
KevinEyo1 Apr 7, 2024
b695c9b
Improve security and upadte message
KevinEyo1 Apr 9, 2024
6db70bc
Merge branch 'master' into 2457-ping-new-contrib
KevinEyo1 Apr 9, 2024
8832b1a
Merge branch 'master' into 2457-ping-new-contrib
KevinEyo1 Apr 10, 2024
7c00b6e
Revert to version number
KevinEyo1 Apr 11, 2024
7e26f6f
Rename variable
KevinEyo1 Apr 11, 2024
03bde6f
Merge branch 'master' into 2457-ping-new-contrib
yucheng11122017 Apr 11, 2024
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
45 changes: 45 additions & 0 deletions .github/workflows/new-contributor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: New Contributor Action
on:
pull_request_target:
types: [closed]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
check-new-contributor:
if: ${{ github.event.pull_request.merged }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Check new contributor
uses: actions/github-script@v7
with:
script: |
const prAuthor = context.payload.pull_request.user.login;
const repoOwner = context.repo.owner;
const repoName = context.repo.repo;
const currentPR = context.payload.pull_request.number;
const mergedPRs = await github.paginate(
github.rest.pulls.list,
{
owner: repoOwner,
repo: repoName,
state: 'closed',
per_page: 100
},
(response) => response.data.filter(pr => pr.merged_at != null && pr.user.login === prAuthor && pr.number !== currentPR)
);
Copy link
Contributor

@itsyme itsyme Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do correct me if I am wrong, from my understanding this gets the last 100 pull requests and checks if the user has a merged PR within the last 100 PRs, would this mean that the comment will be sent for a user that hasn't had any merged PRs in the last 100 PRs?

Copy link
Contributor Author

@KevinEyo1 KevinEyo1 Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @itsyme, thanks for the review, it actually collects all the PRs, its just that it collects them 100 at a time for the pagination. You can refer to here. github-scripts uses octokit

if (mergedPRs.length == 0) {
github.rest.issues.createComment({
issue_number: context.payload.pull_request.number,
owner: repoOwner,
repo: repoName,
body: `**Welcome**, @${prAuthor}! 🎉 Thank you for your contribution to the MarkBind project!\n\nDo remember to request someone to add you as a official contributor to our repository, if you want to of course! See the full list of contributors [here](https://markbind.org/about.html). ✨`
});
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion docs/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mark {
}

.nav-component {
overflow-y: auto;
overflow-y: scroll;
}

#page-nav {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mark {
}

.nav-component {
overflow-y: auto;
overflow-y: scroll;
}

#page-nav {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mark {
}

.nav-component {
overflow-y: auto;
overflow-y: scroll;
}

#page-nav {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mark {
}

.nav-component {
overflow-y: auto;
overflow-y: scroll;
}

#page-nav {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mark {
}

.nav-component {
overflow-y: auto;
overflow-y: scroll;
}

#page-nav {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mark {
}

.nav-component {
overflow-y: auto;
overflow-y: scroll;
}

#page-nav {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ mark {
}

.nav-component {
overflow-y: auto;
overflow-y: scroll;
}

#page-nav {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/template/default/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mark {
}

.nav-component {
overflow-y: auto;
overflow-y: scroll;
}

#page-nav {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/template/project/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ mark {
}

.nav-component {
overflow-y: auto;
overflow-y: scroll;
}

#page-nav {
Expand Down
Loading