Skip to content

Commit

Permalink
Merge pull request #8 from Asymtode712/patch-1
Browse files Browse the repository at this point in the history
Org invitation automation
  • Loading branch information
sanjay-kv authored Aug 17, 2024
2 parents 0f6c802 + e83299a commit cf09b42
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/invite.yml
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)
45 changes: 45 additions & 0 deletions .github/workflows/invitation.yml
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 }}

0 comments on commit cf09b42

Please sign in to comment.