diff --git a/.github/workflows/issue-invite.yml b/.github/workflows/issue-invite.yml new file mode 100644 index 0000000..48081f8 --- /dev/null +++ b/.github/workflows/issue-invite.yml @@ -0,0 +1,25 @@ +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 + }); \ No newline at end of file