From 9a6bf18ec41de733e26e35d6d2b593be5b02b29b Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Mon, 2 May 2022 08:29:30 -0700 Subject: [PATCH 1/2] Update CONTRIBUTING.md Clarify instructions for updating required checks --- CONTRIBUTING.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1346a9aa32..54a5b52639 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,10 +84,11 @@ Since the `codeql-action` runs most of its testing through individual Actions wo To regenerate the PR jobs for the action: -1. From a terminal, run the following commands (replace `SHA` with the sha of the commit whose checks you want to use, typically this should be the latest from `main`): +1. In a terminal check out the `SHA` whose checks you want to use as the base. Typically, this will be `main`. +2. From a terminal, run the following commands (replace `SHA` with the sha of the commit whose checks you want to use, typically this should be the latest from `main`): ```sh - SHA= #### + SHA="$(git rev-parse HEAD)" 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" or . == "Update Supported Enterprise Server Versions" | not)]')" echo "{\"contexts\": ${CHECKS}}" > checks.json gh api -X "PATCH" repos/github/codeql-action/branches/main/protection/required_status_checks --input checks.json @@ -95,7 +96,7 @@ To regenerate the PR jobs for the action: gh api -X "PATCH" repos/github/codeql-action/branches/releases/v1/protection/required_status_checks --input checks.json ```` -2. Go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules have been updated. +3. Go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules have been updated. ## Resources From c9882bef2d31cff1d1f734e3b95ea8e39ea99566 Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Mon, 2 May 2022 08:58:10 -0700 Subject: [PATCH 2/2] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 54a5b52639..a80cb587db 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,7 +85,7 @@ Since the `codeql-action` runs most of its testing through individual Actions wo To regenerate the PR jobs for the action: 1. In a terminal check out the `SHA` whose checks you want to use as the base. Typically, this will be `main`. -2. From a terminal, run the following commands (replace `SHA` with the sha of the commit whose checks you want to use, typically this should be the latest from `main`): +2. From a terminal, run the following commands: ```sh SHA="$(git rev-parse HEAD)"