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

feat: Enable "renovate changeset" action to work with dependabot #153

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ScottGuymer
Copy link

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).

@ScottGuymer ScottGuymer force-pushed the main branch 2 times, most recently from 6267d4a to ee3524b Compare May 5, 2024 20:33
@freben
Copy link
Member

freben commented Jun 4, 2024

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 lib?

@ScottGuymer
Copy link
Author

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
Copy link
Member

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?

Copy link
Author

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,
Copy link
Member

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())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot the slash here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants