Skip to content

Commit 04d521d

Browse files
committed
Avoid using sed, use --slurp instead
1 parent 111428c commit 04d521d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Here are a few things you can do that will increase the likelihood of your pull
7272

7373
Approve the mergeback PR and automerge it. Once the mergeback has been merged into main, the release is complete.
7474

75-
## Keeping the PR checks up to date (requires admin access)
75+
## Keeping the PR checks up to date (admin access required)
7676

7777
Since the `codeql-action` runs most of its testing through individual Actions workflows, there are over two hundred jobs that need to pass in order for a PR to turn green. Managing these PR checks manually is time consuming and complex. Here is a semi-automated approach.
7878

@@ -82,8 +82,7 @@ To regenerate the PR jobs for the action:
8282

8383
```sh
8484
SHA= ####
85-
CHECKS="$(gh api repos/github/codeql-action/commits/${SHA}/check-runs --paginate | jq --compact-output --raw-output '[.["check_runs"] | .[].name | select(contains("https://") or . == "CodeQL" or . == "LGTM.com" or . == "Update dependencies" | not)]')"
86-
CHECKS="$(echo $CHECKS | sed -E 's|\].*\[|,|g')" # Because the gh command is paginated, the results are multiple arrays
85+
CHECKS="$(gh api repos/github/codeql-action/commits/${SHA}/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs | .[].name | select(contains("https://") or . == "CodeQL" or . == "LGTM.com" or . == "Update dependencies" | not)]')"
8786
echo "{\"contexts\": ${CHECKS}}" > checks.json
8887
gh api -X "PATCH" repos/github/codeql-action/branches/main/protection/required_status_checks --input checks.json
8988
gh api -X "PATCH" repos/github/codeql-action/branches/v1/protection/required_status_checks --input checks.json

0 commit comments

Comments
 (0)