Skip to content

Invite User to Organization #20

Invite User to Organization

Invite User to Organization #20

Workflow file for this run

on:
issues:
types: [labeled]
jobs:
automate_invite:
runs-on: ubuntu-latest
steps:
- name: Invite on label
uses: vj-abigo/invite-on-label@v1.4
with:
organization: JDStudio
label: 'invite me to the organization'
repo-token: ${{ secrets.GITHUB_TOKEN }}
comment: |
It's awesome to have you contribute to this project! If you're passionate about open source and want to join a welcoming and inclusive community, consider becoming part of our GitHub Organization and Discord Server. We actively help and motivate each other to contribute more often 🤓. If you have any questions, feel free to ask!
<b>Invitation sent to join the GitHub Organization. Welcome to the community 🎉</b><br><br>
Don't forget to set your membership to public once you've accepted the invitation so it’s visible on your GitHub profile. You can do this by going to https://github.com/orgs/jaidevstudio/people and changing your membership status to public.<br><br>
Tips for practising:<br>Collaboration, communication, and adding value are key<br>Hope this helps!
env:
INVITE_TOKEN: ${{ secrets.INVITE_TOKEN }}
- name: Post message and close the issue
run: |
# Get the issue number
ISSUE_NUMBER=$(echo "${{ github.event.issue.number }}")
# Post a comment on the issue
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d '{"body": "The invitation has been sent to join the GitHub Organization. The issue will now be closed. Feel free to reach out with any questions!"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER/comments"
# Close the issue
curl -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d '{"state": "closed"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER"