diff --git a/.github/workflows/team-updates.yaml b/.github/workflows/team-updates.yaml new file mode 100644 index 0000000..684599e --- /dev/null +++ b/.github/workflows/team-updates.yaml @@ -0,0 +1,24 @@ +name: Team Updates +on: + + # enable manual trigger via github actions interface + workflow_dispatch: + + # trigger on push to main branch + push: + branches: + - main + +jobs: + # Send a cross-repository workflow dispatch request to the team-management repo + # Team management repo workflow will take action on event_type community_teams_update + dispatch-team-management: + if: github.repository == 'cilium/community' + name: Dispatch Team Management + runs-on: ubuntu-latest + environment: team-management + steps: + # Send the workflow dispatch event via GitHUB API + - name: Dispatch workflow request + run: | + curl --fail-with-body -L -XPOST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{secrets.TM_DISPATCH_TOKEN}}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/cilium/team-management/dispatches -d '{"event_type":"community_teams_update"}' diff --git a/tools/aggregate_team_overrides.sh b/tools/aggregate_team_overrides.sh new file mode 100755 index 0000000..1675cde --- /dev/null +++ b/tools/aggregate_team_overrides.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Copyright Authors of Cilium +# SPDX-License-Identifier: Apache-2.0 + +## +# This script is used to generate an aggregate team membership +# file based on a directory of yaml files of the +# form team-name.yaml +# This tool is used as part of team-management automation +## + +set -eu +set -o pipefail + +# $1 - teams directory +if [ $# -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +>&2 echo "> Aggregating Teams from $1/*.yaml" + +cd "$1" +echo "teams:" +for file in *.yaml; do + >&2 echo ">> Processing: $file" + f="${file%.*}" + echo " $f:" + sed 's/^/ /' "$file" +done +