Skip to content

Create new Django Commons teams for a project 🐍 #5

Create new Django Commons teams for a project 🐍

Create new Django Commons teams for a project 🐍 #5

Workflow file for this run

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' | jq '.id' | tr -d '"')
echo $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' -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'