Skip to content

Instantly share code, notes, and snippets.

View koozz's full-sized avatar
🦀

Jan van den Berg koozz

🦀
View GitHub Profile
package person
deny["Missing name."] {
not input.person.name
}
deny["Missing 'teams' element."] {
not input.person.teams
}
warn["No team defined, please configure one."] {
count(input.person.teams) == 0
---
name: PR Triage
on: [pull_request]
jobs:
size-label:
name: Size label
runs-on: ubuntu-latest
steps:
@koozz
koozz / teams-as-code-service-snippet.tf
Created November 10, 2021 07:53
Teams-as-Code service snippet
locals {
# List users by their key
tac_users = {
for user in var.users : lower(user.key) => user
}
# List teams with the users that have this team defined in their teams block
tac_teams = {
for team in var.teams : lower(team.name) => [
for key, user in local.tac_users : key if contains((user.teams == null ? [] : user.teams), lower(team.name))
]
@koozz
koozz / teams-as-code-consumer.tf
Created November 10, 2021 07:49
Teams-as-Code consumer snippet
locals {
users = [
for f in fileset(path.module, "../persons/*.yml") : yamldecode(file(f)).person
]
teams = [
for f in fileset(path.module, "../teams/*.yml") : yamldecode(file(f)).team
]
roles = [
for f in fileset(path.module, "../roles/*.yml") : yamldecode(file(f)).role
]

Keybase proof

I hereby claim:

  • I am koozz on github.
  • I am koozz (https://keybase.io/koozz) on keybase.
  • I have a public key ASDECwaQKDIDaPjSMtFKfFgztLtJrVH3Jbr7pICwd8F1cQo

To claim this, I am signing this object:

@koozz
koozz / qlock
Last active August 29, 2015 13:59
Fix leading zero on the minutes.
#!/bin/bash
# On/off visual
on=$(tput setaf 2)
off=$(tput setaf 0)
# Qlock data
qlock=(
I T L I S A S T I M E
A C Q U A R T E R D C