github.com/grafana/synthetic-monitoring-agent@v0.64.2/scripts/gen-policy-bot-config (about)

     1  #!/bin/sh
     2  
     3  set -e
     4  set -u
     5  
     6  IMAGE=ghcr.io/grafana/generate-policy-bot-config:latest
     7  
     8  targetdir=${1:-}
     9  mergearg=
    10  
    11  if test -z "${targetdir}" ; then
    12  	targetdir=$(git rev-parse --show-toplevel)
    13  fi
    14  
    15  if test -f "${targetdir}/.policy.yml.tmpl" ; then
    16  	mergearg="--merge-with=.policy.yml.tmpl"
    17  fi
    18  
    19  docker run --rm                       \
    20  	--volume "${targetdir}:/work" \
    21  	--user "$(id -u):$(id -g)"    \
    22  	--workdir /work               \
    23  	"${IMAGE}"                    \
    24  	--output /work/.policy.yml    \
    25  	"${mergearg}"                 \
    26  	.