Merge pull request #29424 from lukealbao/luke/branch-slash-doc

[docs] add branch naming caveat to github discovery integration
This commit is contained in:
Fredrik Adelöw
2025-04-01 13:02:38 +01:00
committed by GitHub
4 changed files with 36 additions and 1 deletions
@@ -311,4 +311,24 @@ describe('readProviderConfigs', () => {
expect(() => readProviderConfigs(config)).toThrow();
});
it('throws an error when filters.branch contains a slash', () => {
const config = new ConfigReader({
catalog: {
providers: {
github: {
invalidBranchUser: {
organization: 'test-org',
catalogPath: '/*/catalog-info.yaml',
filters: {
branch: 'test/a',
},
},
},
},
},
});
expect(() => readProviderConfigs(config)).toThrow();
});
});
@@ -104,6 +104,12 @@ function readProviderConfig(
);
}
if (branchPattern?.includes('/')) {
throw new Error(
'Error while processing GitHub provider config. Slash characters (/) are not allowed in filters.branch',
);
}
const schedule = config.has('schedule')
? readSchedulerServiceTaskScheduleDefinitionFromConfig(
config.getConfig('schedule'),