Skip to content

Commit 97a70e6

Browse files
include missing changes
1 parent 90d1a31 commit 97a70e6

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,16 @@ Use the `config-file` parameter of the `init` action to enable the configuration
9696
config-file: ./.github/codeql/codeql-config.yml
9797
```
9898

99-
The configuration file must be located within the local repository. For information on how to write a configuration file, see "[Using a custom configuration file](https://help.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#using-a-custom-configuration-file)."
99+
The configuration file can be located in a different repository. This is useful if you want to share the same configuration across multiple repositories. If the configuration file is in a private repository you can also specify an `external-repository-token` option. This should be a personal access token that has read access to any repositories containing referenced config files and queries.
100+
101+
```yaml
102+
- uses: github/codeql-action/init@v1
103+
with:
104+
config-file: owner/repo/codeql-config.yml@branch
105+
external-repository-token: ${{ secrets.EXTERNAL_REPOSITORY_TOKEN }}
106+
```
107+
108+
For information on how to write a configuration file, see "[Using a custom configuration file](https://help.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#using-a-custom-configuration-file)."
100109

101110
If you only want to customise the queries used, you can specify them in your workflow instead of creating a config file, using the `queries` property of the `init` action:
102111

init/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ inputs:
1919
queries:
2020
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file; prefix with "+" to use both sets of queries.
2121
required: false
22+
external-repository-token:
23+
description: A token for fetching external config files and queries if they reside in a private repository.
24+
required: false
2225
setup-python-dependencies:
2326
description: Try to auto-install your python dependencies
2427
required: true

0 commit comments

Comments
 (0)