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

Added Github Workflow for Greeting contributor on their first PR merge #480

Merged
merged 5 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
38 changes: 38 additions & 0 deletions .github/workflows/greet_on_first_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Greet on User First PR Merge

on:
pull_request:
types: [closed]

jobs:
greet:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const prNumber = context.payload.pull_request.number;
const authorLogin = context.payload.pull_request.user.login;

const firstPR = await github.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
pull_requests: {
state: 'closed',
author: authorLogin,
},
});

console.log(firstPR.data.length);

if (firstPR.data.length === 1) {
const greetingMessage = ` Congratulations, @${authorLogin}! This is your first pull request merge. Thank you for your contribution! `;
Maykkkk marked this conversation as resolved.
Show resolved Hide resolved

await github.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: greetingMessage
});
}
6 changes: 4 additions & 2 deletions components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,13 @@ const MainNavigation = () => {
)
}

const MobileNav = () => {
const MobileNav: React.FC = () => {
benjagm marked this conversation as resolved.
Show resolved Hide resolved
const section = useContext(SectionContext)

const marginTopClass = section !== 'tools' && section !== 'blog' ? 'mt-16' : '';

return (
<div className='flex flex-col justify-end fixed shadow-xl bg-white w-full z-[190] mt-16 left-0 pl-8'>
<div className={`flex flex-col justify-end fixed shadow-xl bg-white w-full z-[190] left-0 pl-8 ${marginTopClass}`}>
<MainNavLink
uri='/specification'
label='Specification'
Expand Down