Skip to content

Commit

Permalink
automating invite workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vacaramin committed Feb 28, 2024
1 parent a12cbf0 commit 181090a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/issue-invite.yml
Original file line number Diff line number Diff line change
@@ -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
});

0 comments on commit 181090a

Please sign in to comment.