You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4-16
Original file line number
Diff line number
Diff line change
@@ -80,23 +80,11 @@ Here are a few things you can do that will increase the likelihood of your pull
80
80
81
81
## Keeping the PR checks up to date (admin access required)
82
82
83
-
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. You can regenerate the checks automatically by running the [Update requiredchecks](.github/workflows/update-required-checks.yml) workflow.
83
+
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. You can regenerate the checks automatically by running the [update-required-checks.sh](.github/workflows/script/update-required-checks.sh) script:
84
84
85
-
Or you can use this semi-automated approach:
86
-
87
-
1. In a terminal check out the `SHA` whose checks you want to use as the base. Typically, this will be `main`.
88
-
2. From a terminal, run the following commands:
89
-
90
-
```sh
91
-
SHA="$(git rev-parse HEAD)"
92
-
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)]')"
93
-
echo"{\"contexts\": ${CHECKS}}"> checks.json
94
-
gh api -X "PATCH" repos/github/codeql-action/branches/main/protection/required_status_checks --input checks.json
95
-
gh api -X "PATCH" repos/github/codeql-action/branches/releases/v2/protection/required_status_checks --input checks.json
96
-
gh api -X "PATCH" repos/github/codeql-action/branches/releases/v1/protection/required_status_checks --input checks.json
97
-
````
98
-
99
-
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.
85
+
1. By default, this script retrieves the checks from the latest SHA on `main`, so make sure that your `main` branch is up to date.
86
+
2. Run the script. If there's a reason to, you can pass in a different SHA as a CLI argument.
87
+
3. After running, go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules for `main`, `v1`, and `v2` have been updated.
0 commit comments