-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Asymtode712/patch-1
Org invitation automation
- Loading branch information
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Invitation to the GSSoC24 GitHub Community Organization | ||
description: I would like to be part of this awesome community | ||
title: "Please invite me to the GSSoC24 GitHub Community Organization" | ||
labels: [invite me to the community] | ||
body: | ||
- type: input | ||
id: name | ||
attributes: | ||
label: Name | ||
placeholder: Insert your name here | ||
validations: | ||
required: true | ||
- type: input | ||
id: discordname | ||
attributes: | ||
label: Discord Username (if applicable) | ||
placeholder: Insert your Discord username here | ||
validations: | ||
required: false | ||
- type: textarea | ||
id: Additional | ||
attributes: | ||
label: Additional Context | ||
description: What do you like about this community/Why do you want to join? | ||
validations: | ||
required: false | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Feel free to check out other cool repositories of the GSSoC24 Community [here](https://github.com/GSSoC24) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Automate Invitation | ||
|
||
on: | ||
issues: | ||
types: [labeled] | ||
|
||
jobs: | ||
handle_label: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- 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: Close Original Issue in Support 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: gssoc24 | ||
label: invite me to the community | ||
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/gssoc24/people<br><br> | ||
env: | ||
INVITE_TOKEN: ${{ secrets.INVITE_TOKEN }} |