feat: Enable "renovate changeset" action to work with dependabot#153
feat: Enable "renovate changeset" action to work with dependabot#153ScottGuymer wants to merge 2 commits intobackstage:mainfrom
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.
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.
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.
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
|
|
||
| if (!branchName.startsWith('renovate/')) { | ||
| core.info('Not a renovate branch, skipping'); | ||
| if (!branchName.startsWith(getDependencyManager())) { |
| .getInput('dependency-manager', { | ||
| required: false, | ||
| }) | ||
| .trim() |
There was a problem hiding this comment.
FYI core already trims this for you. You have to pass an option if you don't want it to trim for you.
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).