Skip to content
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
30 changes: 23 additions & 7 deletions .github/workflows/autocomment-pr-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,33 @@ on:
pull_request:
types: [closed]

permissions:
issues: write
pull-requests: write

jobs:
notify:
if: github.event.pull_request.merged == true
comment:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.event.pull_request.merged == true

steps:
- name: Post merge comment
- name: Checkout Repository
uses: actions/checkout@v2

- name: Add Comment to Issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -H "Authorization: token $GITHUB_TOKEN" \
-X POST \
-d '{"body":"🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there's anything else we can assist you with. Keep up the fantastic work! 🚀"}' \
"https://github.com/api/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
COMMENT=$(cat <<EOF
{
"body": "🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there's anything else we can assist you with. Keep up the fantastic work! 🚀"
}
EOF
)
curl -X POST \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://github.com/api/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
-d "$COMMENT"
59 changes: 55 additions & 4 deletions .github/workflows/invitation.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,68 @@
name: Automate Invitation

on:
issues:
types: [labeled]

jobs:
automate_invite:
handle_label:
runs-on: ubuntu-latest

steps:
- name: Invite on label
- name: Check if Label is 'invite me to the community'
id: check_label
run: |
if [[ "${{ github.event.label.name }}" != "invite me to the community" ]]; then
echo "Label is not 'invite me to the community'. Exiting."
exit 0
fi

- name: Create Issue in Support Repository
id: create_issue
if: ${{ steps.check_label.outcome == 'success' }}
uses: actions/github-script@v5
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
script: |
const issue = context.payload.issue;
const { owner, repo } = context.repo;
const response = await github.rest.issues.create({
owner: 'Recode-Hive',
repo: 'Support',
title: issue.title,
body: issue.body,
labels: ['invite me to the community'],
});
core.setOutput('issue_number', response.data.number);

- name: Close Original Issue in StackOverflow Repository
if: ${{ steps.check_label.outcome == 'success' }}
uses: actions/github-script@v5
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
script: |
const issue = context.payload.issue;
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed'
});

- name: Invite on Label
if: ${{ steps.check_label.outcome == 'success' }}
uses: vj-abigo/[email protected]
with:
organization: Recode-Hive
label: invite me to the community
repo-token: ${{ secrets.GITHUB_TOKEN }}
comment: "<b>Invitation sent to join the GitHub Organisation. Welcome to the community 🎉</b><br><br>Don't forget after accepting to make it public so it appears on your GitHub profile for everyone else to see. You can do this by finding your name in the GitHub organisation list and change the dropdown to public https://github.com/orgs/Recode-Hive/people<br><br>"
repo-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
comment: |
<b>Invitation sent to join the GitHub Organisation. Welcome to the community 🎉</b><br><br>
Don't forget after accepting to make it public so it appears on your GitHub profile for everyone else to see. You can do this by finding your name in the GitHub organisation list and change the dropdown to public https://github.com/orgs/Recode-Hive/people<br><br>
Tips for practising:<br><br>
Customise your GitHub profile, here is a course on that: https://www.udemy.com/course/make-your-github-profile-stand-out/<br>
Practice repo, instructions on how to add your name to the README https://github.com/Recode-Hive/hacktoberfest-practice<br>
Remember contributing to open source is not just about code, it's about collaboration, communication and adding value<br>
I hope that helps
env:
INVITE_TOKEN: ${{ secrets.INVITE_TOKEN }}