{"id":25171820,"url":"https://github.com/basemax/autoinvitetoorgbystar","last_synced_at":"2025-10-16T08:40:58.664Z","repository":{"id":38298954,"uuid":"378421797","full_name":"BaseMax/AutoInviteToOrgByStar","owner":"BaseMax","description":"Auto Join: A GitHub action script to automatically invite everyone to the organization who star your repository.","archived":false,"fork":false,"pushed_at":"2022-06-07T18:43:12.000Z","size":56,"stargazers_count":18,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-05T21:15:13.105Z","etag":null,"topics":["auto-join","auto-join-github","auto-join-org","auto-join-orginization","auto-joiner","github","github-action","github-actions","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-19T13:43:02.000Z","updated_at":"2025-03-22T16:46:35.000Z","dependencies_parsed_at":"2022-09-08T07:33:54.887Z","dependency_job_id":null,"html_url":"https://github.com/BaseMax/AutoInviteToOrgByStar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FAutoInviteToOrgByStar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FAutoInviteToOrgByStar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FAutoInviteToOrgByStar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FAutoInviteToOrgByStar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/AutoInviteToOrgByStar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577026,"owners_count":21770721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto-join","auto-join-github","auto-join-org","auto-join-orginization","auto-joiner","github","github-action","github-actions","python","python3"],"created_at":"2025-02-09T09:22:12.658Z","updated_at":"2025-10-16T08:40:53.592Z","avatar_url":"https://github.com/BaseMax.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auto Invite To The Organization By Star\n\nA GitHub Action script to automatically invite everyone to your organization that `stars` your repository. \n\n## What is this?\n\n### You can FORK and STAR this repository, after that you will be invited to a surprising and fantastic organization.\n\n----------\n\n## Deploy to your organization\n\n#### Create `MY_GITHUB_KEY` variable at Secrets\n\nOpen https://github.com/settings/tokens and create one.\n\nAfter that you can create a secret at `https://github.com/ORG_NAME/REPO_NAME/settings/secrets/actions`.\n\n#### Create `COMMUNITY_TEAM_ID` variable at Secrets\n\nDo not have team id at your org?\n\nAt first, create a team at `https://github.com/orgs/YOUR_ORG_NAME/teams` and run:\n\n```\ncurl -H \"Authorization: token *****\" https://api.github.com/orgs/YOUR_ORG_NAME/teams\n```\n\nP.S: Put your **personal token** at the `****`, and replace your organization name at `YOUR_ORG_NAME`.\n\nAfter that, You can create a secret at `https://github.com/ORG_NAME/REPO_NAME/settings/secrets/actions` and put api number as value.\n\n#### Create `.github/workflows/invite-by-star.yml` file:\n\n```yaml\non:\n  watch:\n    types: [started]\nname: Invite a new user\njobs:\n    build:\n      runs-on: ubuntu-latest\n\n      steps:\n        - name: checkout repo content\n          uses: actions/checkout@v2\n        - name: setup python\n          uses: actions/setup-python@v2\n          with:\n            python-version: 3.8\n        - name: Install dependencies\n          run: |\n            python -m pip install --upgrade pip\n            pip install requests\n            if [ -f ./.github/workflows/requirements.txt ]; then pip install -r requirements.txt; fi\n        - name: execute py script\n          run: |\n            python ./.github/workflows/AutoInviteToOrgByStar.py\n          env:\n            MY_GITHUB_KEY: ${{ secrets.MY_GITHUB_KEY }}\n            COMMUNITY_TEAM_ID: ${{ secrets.COMMUNITY_TEAM_ID }}\n```\n\n### Create `.github/workflows/AutoInviteToOrgByStar.py` file\n\n```python\n# Max Base\n# 2021-06-19\n# https://github.com/BaseMax/AutoInviteToOrgByStar\n\nimport os\nimport sys\nimport json\nimport requests\n\nprint(\"Hello, World\")\n\nif os.getenv('CI'):\n    print('Looks like GitHub!')\nelse:\n    print('Maybe running locally?')\n\nprint(\"Environ:\")\nprint(os.environ)\nprint(\"Prefix:\")\nprint(sys.prefix)\n\nMY_GITHUB_KEY = os.environ['MY_GITHUB_KEY']\nCOMMUNITY_TEAM_ID = os.environ['COMMUNITY_TEAM_ID']\n\nfile = open(os.environ['GITHUB_EVENT_PATH'])\ndata = json.load(file)\n\nprint(\"Data:\")\nprint(data)\n\nUSERNAME = data['sender']['login']\n\nprint('Send invite for the @'+USERNAME)\n\n# TODO: check user already joined or no....\nurl = 'https://api.github.com/teams/'+COMMUNITY_TEAM_ID+'/memberships/' + USERNAME\npayload=''\nheaders = {\n    'Accept': 'application/vnd.github.v3+json',\n    'Authorization': 'token '+MY_GITHUB_KEY\n}\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\nprint(response.text)\n```\n\n© Copyright Max Base, 2021\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fautoinvitetoorgbystar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fautoinvitetoorgbystar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fautoinvitetoorgbystar/lists"}