Skip to content

Commit e142eee

Browse files
committed
Only load repository properties for repos owned by orgs
1 parent 1601acf commit e142eee

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

init/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ inputs:
159159
description: >-
160160
Explicitly enable or disable caching of project build dependencies.
161161
required: false
162+
repository-owner-type:
163+
default: ${{ github.event.repository.owner.type }}
164+
required: false
162165
outputs:
163166
codeql-path:
164167
description: The path of the CodeQL binary used for analysis

lib/init-action.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/init-action.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,13 @@ async function run(startedAt: Date) {
237237
);
238238

239239
// Fetch the values of known repository properties that affect us.
240-
const enableRepoProps = await features.getValue(
241-
Feature.UseRepositoryProperties,
240+
const repositoryOwnerType = getOptionalInput("repository-owner-type");
241+
logger.debug(
242+
`Repository owner type is '${repositoryOwnerType ?? "unknown"}'.`,
242243
);
244+
const enableRepoProps =
245+
repositoryOwnerType === "Organization" &&
246+
(await features.getValue(Feature.UseRepositoryProperties));
243247
const repositoryProperties = enableRepoProps
244248
? await loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo)
245249
: {};

0 commit comments

Comments
 (0)