Skip to content

Commit e8f4871

Browse files
committed
Add some doc for loadRepositoryProperties
1 parent a0671be commit e8f4871

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/init-action.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,15 +797,20 @@ async function run(startedAt: Date) {
797797
);
798798
}
799799

800+
/**
801+
* Loads [repository properties](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization) if applicable.
802+
*/
800803
async function loadRepositoryProperties(
801804
repositoryNwo: RepositoryNwo,
802805
gitHubVersion: GitHubVersion,
803806
features: FeatureEnablement,
804807
logger: Logger,
805808
): Promise<Result<RepositoryProperties, unknown>> {
809+
// See if we can skip loading repository properties early. In particular,
810+
// repositories owned by users cannot have repository properties, so we can
811+
// skip the API call entirely in that case.
806812
const repositoryOwnerType = github.context.payload.repository?.owner.type;
807813
if (repositoryOwnerType === "User") {
808-
// Users cannot have repository properties, so skip the API call.
809814
logger.debug(
810815
"Skipping loading repository properties because the repository is owned by a user and " +
811816
"therefore cannot have repository properties.",

0 commit comments

Comments
 (0)