File tree Expand file tree Collapse file tree 2 files changed +36
-5
lines changed Expand file tree Collapse file tree 2 files changed +36
-5
lines changed Original file line number Diff line number Diff line change @@ -11,14 +11,26 @@ jobs:
1111 update :
1212 runs-on : ubuntu-latest
1313 steps :
14+ - uses : cachix/install-nix-action@v26
15+
1416 - uses : actions/checkout@v4
17+ with :
18+ path : repo
19+
20+ - name : Generate issue body
21+ run : repo/scripts/review-body.sh repo ${{ github.repository }} > body
22+ env :
23+ # This token has read-only admin access to see who has write access to this repo
24+ GH_TOKEN : " ${{ secrets.OWNERS_VALIDATOR_GITHUB_SECRET }}"
25+
1526 - run : |
1627 gh api \
1728 --method POST \
1829 -H "Accept: application/vnd.github+json" \
1930 -H "X-GitHub-Api-Version: 2022-11-28" \
20- /repos/"$GITHUB_REPOSITORY" /issues \
31+ /repos/${{ github.repository }} /issues \
2132 -f title="[$(date +'%Y %B')] Regular manual review " \
22- -f body="$(./scripts/review- body.sh)"
33+ -F body=@ body
2334 env:
35+ # This token has write access to only issues to create one
2436 GH_TOKEN: ${{ github.token }}
Original file line number Diff line number Diff line change 1- #! /usr/bin/env bash
1+ #! /usr/bin/env nix-shell
2+ #! nix-shell -i bash --pure --keep GH_TOKEN -I nixpkgs=channel:nixpkgs-unstable -p codeowners github-cli gitMinimal
3+
24set -euo pipefail
35
46# This script outputs the contents of the regular review issue, see ./github/workflows/review.yml
57
6- rev=$( git rev-parse HEAD)
8+ SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
9+
10+ if (( $# != 2 )) ; then
11+ echo " Usage: $0 PATH OWNER/REPO"
12+ exit 1
13+ fi
14+
15+ root=$1
16+ repo=$2
17+
18+ rev=$( git -C " $root " rev-parse HEAD)
719
820echo " Because the documentation in this repository may slowly deviate from reality, this monthly issue is created to regularly review the files.
921
@@ -30,4 +42,11 @@ while read -r file users; do
3042 continue
3143 fi
3244 echo " - [ ] \` $file \` : $users "
33- done < .github/CODEOWNERS
45+ done < " $root " /.github/CODEOWNERS
46+
47+ echo " "
48+
49+ # Check that all code owners have write permissions
50+ # `|| true` because this script fails when there are code owners without permissions,
51+ # which is useful to fail PRs, but not here
52+ bash " $SCRIPT_DIR " /unprivileged-owners.sh " $root " " $repo " || true
You can’t perform that action at this time.
0 commit comments