Auto Join: A GitHub action script to automatically invite everyone to the organization who comment at the issue page.

Overview

Auto Invite To Org By Issue Comment

A GitHub action script to automatically invite everyone to the organization who comment at the issue page.

What is this?

START, FORK this.

Next You can write .invite me at here, after that you will be invited to a surprising and fantastic organization.


Deploy to your organization

Create MY_GITHUB_KEY variable at Secrets

Open https://github.com/settings/tokens and create one.

After that you can create a secret at https://github.com/ORG_NAME/REPO_NAME/settings/secrets/actions.

Create COMMUNITY_TEAM_ID variable at Secrets

Do not have team id at your org?

Running:

curl -H "Authorization: token *****" https://api.github.com/orgs/YOUR_ORG_NAME/teams

p.s: Put your personal token at the ****, and replace your organization name at YOUR_ORG_NAME.

After that you can create a secret at https://github.com/ORG_NAME/REPO_NAME/settings/secrets/actions.

Create .github/workflows/invite-by-comment.yml file:

on:
  issue_comment:
    types: [created, edited]
name: Invite a new user by comment
jobs:
    build:
      runs-on: ubuntu-latest

      steps:
        - name: checkout repo content
          uses: actions/[email protected]
        - name: setup python
          uses: actions/[email protected]
          with:
            python-version: 3.8
        - name: Install dependencies
          run: |
            python -m pip install --upgrade pip
            pip install requests
            if [ -f ./.github/workflows/requirements.txt ]; then pip install -r ./.github/workflows/requirements.txt; fi
        - name: execute py script
          run: |
            python ./.github/workflows/AutoInviteToOrgByIssueComment.py
          env:
            MY_GITHUB_KEY: ${{ secrets.MY_GITHUB_KEY }}
            COMMUNITY_TEAM_ID: ${{ secrets.COMMUNITY_TEAM_ID }}

Create .github/workflows/AutoInviteToOrgByIssueComment.py file

# Max Base
# 2021-06-19
# https://github.com/BaseMax/AutoInviteToOrgByIssueComment

import os
import sys
import json
import requests

print("Hello, World")

if os.getenv('CI'):
    print('Looks like GitHub!')
else:
    print('Maybe running locally?')

print("Environ:")
print(os.environ)
print("Prefix:")
print(sys.prefix)

MY_GITHUB_KEY = os.environ['MY_GITHUB_KEY']
COMMUNITY_TEAM_ID = os.environ['COMMUNITY_TEAM_ID']

file = open(os.environ['GITHUB_EVENT_PATH'])
data = json.load(file)

print("Data:")
print(data)

COMMENT = data["comment"]["body"]
USERNAME = data["comment"]["user"]["login"]

if ".invite @" not in COMMENT and ".invite me" not in COMMENT:
  sys.exit()
else:

  if ".invite @" in COMMENT
    USERNAME = COMMENT.replace(".invite @", "")

  print('Send invite for the @'+USERNAME)

  # TODO: check user already joined or no....
  url = 'https://api.github.com/teams/'+COMMUNITY_TEAM_ID+'/memberships/' + USERNAME
  payload=''
  headers = {
      'Accept': 'application/vnd.github.v3+json',
      'Authorization': 'token '+MY_GITHUB_KEY
  }
  response = requests.request("PUT", url, headers=headers, data=payload)
  print(response.text)

© Copyright Max Base, 2021

Owner
Max Base
@github developer maintainer. Full-Time Open-Sourcerer. Full-stack programmer. In the path of a real computer engineer... (Compiler enthusiast)
Max Base
Reads and prints information from the website MalAPI.io

MalAPIReader Reads and prints information from the website MalAPI.io optional arguments:

Squiblydoo 16 Nov 10, 2022
Tinkoff social pulse api wrapper

Tinkoff social pulse api wrapper

Semenov Artur 9 Dec 20, 2022
Tools to download and aggregate feeds of vaccination clinic location information in the United States.

vaccine-feed-ingest Pipeline for ingesting nationwide feeds of vaccine facilities. Contributing How to Configure your environment (instructions on the

Call the Shots 26 Aug 05, 2022
OpenZeppelin Contracts written in Cairo for StarkNet, a decentralized ZK Rollup

OpenZeppelin Cairo Contracts A library for secure smart contract development written in Cairo for StarkNet, a decentralized ZK Rollup. ⚠️ WARNING! ⚠️

OpenZeppelin 592 Jan 04, 2023
Discord Token Generator - Python (Generates Tokens and Joins your Server Automatically) hCaptcha Bypass **FREE**

Best Discord Token Generator {hCaptcha bypass FREE Unlimited Memberboost} Install few requirements & run main.py it will redirect you to the Download

1 Oct 27, 2021
Using twitter lists as your feed

Twitlists A while ago, Twitter changed their timeline to be algorithmically-fed rather than a simple reverse-chronological feed. In particular, they p

Peyton Walters 5 Nov 21, 2022
A telegram bot for generate fake details. Written in python using telethon

FakeDataGenerator A telegram bot for generate fake details. Written in python using telethon. Mandatory variables API_HASH Get it from my telegram.org

Oxidised-Man 6 Dec 19, 2021
Pack up to 3MB of data into a tweetable PNG polyglot file.

tweetable-polyglot-png Pack up to 3MB of data into a tweetable PNG polyglot file. See it in action here: https://twitter.com/David3141593/status/13719

David Buchanan 2.4k Dec 29, 2022
A simple, fast, and awesome discord nuke bot! The only thing you need to add is your bot token.

SimpleNukeBot A simple, fast, and awesome discord nuke bot! The only thing you need to add is your bot token. Instructions: All you need to do is crea

Bisc 1 Apr 18, 2022
This is a simple program that uses Python and pyTwitchAPI to retrieve the list of users in a streamer's chat and then checks each one of these users to see if they follow the broadcaster or not

This is a simple program that uses Python and pyTwitchAPI to retrieve the list of users in a streamer's chat and then checks each one of these users to see if they follow the broadcaster or not

RwinShow 57 Dec 18, 2022
Telegram bot for stream music on telegram, powered by py-tgcalls and Pyrogram

Telegram Streamer Bot Telegram bot for stream music on telegram, powered by py-tgcalls and Pyrogram ✨ Features Coming soon, help me to improve it 🛠 C

Shohih Abdul 11 Oct 21, 2022
Der Dischkort Bot für Andiismus

AndreOS Der Dischkort Bot für Andiismus Wichtigger Bot für den hauseigenen Discord-Server Indoktrinationsmechanismusleitungsprogramm der andiistischen

Leon Bartle 3 Jan 13, 2022
Modified Version Of Media Search bot

Modified Version Of Media Search bot

1 Oct 09, 2021
Library to manage your own custom RPC on your desktop

Info I don't recommend novices setting this up yourself. It requires Redis, a server to host the API on, and a bit of understanding of Windows & Pytho

Isaac K 1 Apr 16, 2022
Github repository started notify 💕

Github repository started notify 💕

4 Aug 06, 2022
Quot-a-lecture - Lecture transcript question extraction

Setup virtualenv venv source venv/bin/activate pip install -r requirements.txt

Pratyaksh Sharma 5 Sep 12, 2022
Contrastive Language-Audio Pretraining

CLAP Contrastive Language-Audio Pretraining In due time this repo will be full of lovely things, I hope. Feel free to check out the Issues if you're i

Charles Foster 83 Dec 01, 2022
GitHub action to deploy serverless functions to YandexCloud

YandexCloud serverless function deploy action Deploy new serverless function version (including function creation if it does not exist). Inputs yc_acc

Много Лосося 4 Apr 10, 2022
A light weight Python library for the Spotify Web API

Spotipy A light weight Python library for the Spotify Web API Documentation Spotipy's full documentation is online at Spotipy Documentation. Installat

Paul Lamere 4.2k Jan 06, 2023
A very basic starter bot based on CryptoKKing with a small balance

starterbot A very basic starter bot based on CryptoKKing with a small balance, use at your own risk. I have since upgraded this script significantly a

Danny Kendrick 2 Dec 05, 2021