-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add team management automation tooling to facilite self-service team …
…membership Signed-off-by: Jef Spaleta <[email protected]>
- Loading branch information
1 parent
0c6647a
commit 4e1dbce
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
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
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"}' |
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
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 | ||
|