Update action and file change
This commit is contained in:
Родитель
279a0ccfbc
Коммит
39458ffcee
11
audit.yaml
11
audit.yaml
|
@ -9,3 +9,14 @@ entitlements/strictly_audited/admin.txt:
|
|||
days: 182
|
||||
strategy: manager
|
||||
title: Admin access
|
||||
entitlements/strictly_audited/user.txt:
|
||||
sha256sum: ad4b73042433ca4bd475664fff6480de9225284173e18c9d661cb1158d164e0d
|
||||
format:
|
||||
- txt
|
||||
reviews:
|
||||
enabled: true
|
||||
labels:
|
||||
- Periodic Audit
|
||||
days: 182
|
||||
strategy: manager
|
||||
title: User access
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
username = danhoerst
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -z $GITHUB_HEAD_REF ];
|
||||
then
|
||||
GITHUB_HEAD_REF=$(git rev-parse --abbrev-ref HEAD)
|
||||
fi
|
||||
|
||||
# Get the PR diff
|
||||
diff=$(git diff origin/main origin/${GITHUB_HEAD_REF})
|
||||
audit_files=()
|
||||
# See if the PR diff is related to entitlements configs
|
||||
while IFS='' read -r FILES; do
|
||||
for line in "${FILES[@]}"; do
|
||||
if [[ $line = "+++ "* ]] || [[ $line = "--- "* ]]
|
||||
then
|
||||
IFS=" " read add_remove file_name <<< $line
|
||||
echo $file_name
|
||||
# Grab the manager from the Org Chart for each affected user
|
||||
audited_files=$(yq 'keys' "audit.yaml")
|
||||
for i in "${audited_files[@]}"
|
||||
do
|
||||
:
|
||||
audited_file=$(echo ${i} | sed 's/- //')
|
||||
if [[ $file_name == *"$audited_file"* ]];
|
||||
then
|
||||
echo "YES"
|
||||
fi
|
||||
done
|
||||
IFS=''
|
||||
fi
|
||||
done
|
||||
done <<< "$diff"
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -z $GITHUB_HEAD_REF ];
|
||||
then
|
||||
GITHUB_HEAD_REF=$(git rev-parse --abbrev-ref HEAD)
|
||||
fi
|
||||
|
||||
# Get the PR diff
|
||||
diff=$(git diff origin/main origin/${GITHUB_HEAD_REF})
|
||||
# See if the PR diff is related to entitlements configs
|
||||
while IFS='' read -r FILES; do
|
||||
echo "${FILES[@]}"
|
||||
done <<< "$diff"
|
Загрузка…
Ссылка в новой задаче