Skip to content

Commit

Permalink
add team management automation tooling to facilite self-service team …
Browse files Browse the repository at this point in the history
…membership

Signed-off-by: Jef Spaleta <[email protected]>
  • Loading branch information
jspaleta authored and joestringer committed Jan 22, 2025
1 parent 0c6647a commit 4e1dbce
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/team-updates.yaml
Original file line number Diff line number Diff line change
@@ -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"}'
31 changes: 31 additions & 0 deletions tools/aggregate_team_overrides.sh
Original file line number Diff line number Diff line change
@@ -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 <TEAMS_DIRECTORY>"
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

0 comments on commit 4e1dbce

Please sign in to comment.