-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: Enable "renovate changeset" action to work with dependabot #153
base: main
Are you sure you want to change the base?
Conversation
6267d4a
to
ee3524b
Compare
Hi! What would we rename it to though? Would it make sense to make a second dedicated action for this instead, and move the commonalities as a helper into |
Maybe dependency-changeset or something like that. maybe copy to a new action and then mark the current one as deprecated |
@@ -1,10 +1,14 @@ | |||
name: Backstage Renovate Changeset Creator | |||
description: Create changesets on the renovate bot PR's if needed | |||
name: Backstage Dependency Manager Changeset Creator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The action is still named renovate-changesets
though.
Hm. Should we make a new parallel one that has this new ability (and is named dependency-manager-changesets
)? Possibly deprecating the existing one later down the line in a separate PR.
Alternatively: Should we instead make a new parallel one specifically named dependabot-changesets
and leave the old one intact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The former would require some upstream changes.
The latter would probably create more duplicated code (or the need to share code)
export const getDependencyManager = (): string => { | ||
return core | ||
.getInput('dependency-manager', { | ||
required: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's set with a default in the yaml file. But still marked as not required here? What's even the return type here, can .trim
below get an undefined error if the default wasn't there? See the comment above; maybe it's better to just make two actions that are specialized, or change around how this works a bit
|
||
const isMultipleWorkspaces = core.getBooleanInput('multiple-workspaces', { | ||
required: false, | ||
}); | ||
|
||
const branchName = await getBranchName(); | ||
|
||
if (!branchName.startsWith('renovate/')) { | ||
core.info('Not a renovate branch, skipping'); | ||
if (!branchName.startsWith(getDependencyManager())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot the slash here
Add in the ability for the renovate changeset action to work with different dependency managers such as dependabot.
I needed/wanted to add this for our own plugins repo so thought it might be a worthwhile contribution.
I didnt go as far as renaming the action itself but that would make sense at some point (if this PR is accepted).