Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "cannot read property of undefined" error; Fix GitHub image pull rate-limiting #1353

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion extension/tasks/dependabotV2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ async function run() {
);

const dependabotUpdaterOptions = {
gitHubAccessToken: taskInputs.githubAccessToken,
collectorImage: undefined, // TODO: Add config for this?
proxyImage: undefined, // TODO: Add config for this?
updaterImage: undefined, // TODO: Add config for this?
Expand Down Expand Up @@ -101,7 +102,7 @@ async function run() {
updateId,
update,
dependabotConfig.registries,
dependencyList['dependencies'],
dependencyList?.['dependencies'],
existingPullRequestDependencies,
);
const allDependenciesUpdateOutputs = await dependabot.update(allDependenciesJob, dependabotUpdaterOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class DependabotCli {
public async update(
operation: IDependabotUpdateOperation,
options?: {
gitHubAccessToken?: string;
collectorImage?: string;
proxyImage?: string;
updaterImage?: string;
Expand Down Expand Up @@ -81,6 +82,10 @@ export class DependabotCli {
const dependabotResultCode = await dependabotTool.execAsync({
failOnStdErr: false,
ignoreReturnCode: true,
env: {
DEPENDABOT_JOB_ID: jobId.replace(/-/g, '_'), // replace hyphens with underscores
LOCAL_GITHUB_ACCESS_TOKEN: options?.gitHubAccessToken, // avoid rate-limiting when pulling images from GitHub container registries
},
});
if (dependabotResultCode != 0) {
error(`Dependabot failed with exit code ${dependabotResultCode}`);
Expand Down