Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rtpascual committed Dec 30, 2024
1 parent a79bfee commit f46e30d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/components/dependabot_version_update_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,26 @@ export class DependabotVersionUpdateHandler {
* We also want to run our E2E tests on these version updates to ensure new dependency updates don't break us.
*
* Running this method when either of the following are true results in a no-op:
* 1. GitHub context event is not a pull request
* 2. Branch PR does not start with 'dependabot/', meaning the branch isn't for a Dependabot PR
* 3. PR already has a changeset in list of files changed
* - GitHub context event is not a pull request
* - Branch PR does not start with `dependabot/`, meaning the branch isn't for a Dependabot PR
* - PR already has a changeset in list of files changed
*/
handleVersionUpdate = async () => {
if (!this._ghContext.payload.pull_request) {
// event is not a pull request, return early
process.exit();
return;
}

const branch = await this.gitClient.getCurrentBranch();
if (!branch.startsWith('dependabot/')) {
// if branch is not a dependabot branch, return early
process.exit();
return;
}

const changedFiles = await this.gitClient.getChangedFiles(this.baseRef);
if (changedFiles.find((file) => file.startsWith('.changeset'))) {
// if changeset file already exists, return early
process.exit();
return;
}

// Get all of the public packages with version updates (where 'package.json' is modified)
Expand Down

0 comments on commit f46e30d

Please sign in to comment.