Create new Django Commons teams for a project π #8
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: Create new Django Community teams for a project π | |
on: | |
workflow_dispatch: | |
inputs: | |
repo: | |
description: "The slug of the repository in django-community" | |
required: true | |
type: string | |
base-team-name: | |
description: "The base team name. Typically should match repo" | |
required: true | |
type: string | |
jobs: | |
create-teams: | |
name: Create teams π¦ | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create teams and assign permissions | |
env: | |
GH_TOKEN: ${{ secrets.GH_FINE_GRANTED_PAT }} | |
run: | | |
TEAM_ID=$(gh api -X POST /orgs/django-community/teams -f name=${{ inputs.base-team-name }}-committers -f description="People who have the ability to commit and maintain the project." -f privacy="closed") | |
echo $TEAM_ID | |
TEAM_ID = $(echo $TEAM_ID | jq ".id") | |
gh api -X POST /orgs/django-community/teams -f name=${{ inputs.base-team-name }}-committers -f description="People who have the ability to commit and maintain the project." -f privacy="closed" -F parent_team_id=$TEAM_ID | |
gh api -X POST /orgs/django-community/teams -f name="${{ inputs.base-team-name }}-maintainers" -f description="People who administrate the project." -f privacy="closed" -F parent_team_id=$TEAM_ID | |
gh api -X PUT "/orgs/django-community/teams/${{ inputs.base-team-name }}/repos/django-community/${{ inputs.repo }}" -f permission="triage" | |
gh api -X PUT "/orgs/django-community/teams/${{ inputs.base-team-name }}-committers/repos/django-community/${{ inputs.repo }}" -f permission="write" | |
gh api -X PUT "/orgs/django-community/teams/${{ inputs.base-team-name }}-admins/repos/django-community/${{ inputs.repo }}" -f permission="maintain" |