Please invite me to the GitHub Community Organization #2
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
name: Send Organization Invite | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
send-invite: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Send Organization Invite | |
uses: actions/github-script@v4 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const { Octokit } = require('@octokit/rest'); | |
const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN }); | |
const orgName = 'YOUR_ORGANIZATION_NAME'; | |
const username = context.payload.issue.user.login; | |
octokit.orgs.createInvitation({ | |
org: orgName, | |
invitee_id: username | |
}); |