diff --git a/.github/workflows/committee_creation.yml b/.github/workflows/committee_creation.yml index c055e3fb3357742b838843f4ed959685bd908ec3..16cddbd7000a709eccbca4b7bc0c98a2775797b0 100644 --- a/.github/workflows/committee_creation.yml +++ b/.github/workflows/committee_creation.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Generate Committee File run: | @@ -19,6 +19,13 @@ jobs: sed "s/class example/class $branch_name/g" src/Committees/example.py > "src/Committees/${branch_name}.py" shell: bash + - name: Switch to New Branch + run: | + branch_name=${{ github.ref }} + git fetch origin $branch_name:$branch_name + git checkout $branch_name + shell: bash + - name: Create Committee Team env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -29,3 +36,14 @@ jobs: -H "Authorization: Bearer $GITHUB_TOKEN" \ -d '{"name":"'$branch_name'","privacy":"closed"}' \ https://api.github.com/orgs/YOUR_ORG/teams + + - name: Create Team + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + branch_name=${{ github.ref }} + branch_name=${branch_name#refs/heads/comm/} + curl -X POST \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -d '{"name":"'$branch_name'","privacy":"closed"}' \ + https://api.github.com/orgs/YOUR_ORG/teams