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

Add pull request branch configuration #40

Merged
merged 1 commit into from
Dec 16, 2022
Merged

Add pull request branch configuration #40

merged 1 commit into from
Dec 16, 2022

Conversation

jmlemetayer
Copy link
Contributor

@jmlemetayer jmlemetayer commented Nov 2, 2022

This fixes #39

There is 2 new configuration:

  • pull_request_branch: The pull request branch name.
  • pull_request_unique: Is the pull request branch unique? If "false" the branch will be suffixed with a timestamp.

By default the branch is not unique and is suffixed with a timestamp, and the name is gh-actions-update.

The current default behavior is unchanged.

Copy link
Owner

@saadmk11 saadmk11 left a comment

Choose a reason for hiding this comment

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

Thanks for creating the PR! 👍

By default the branch is now static, and the name is gh-actions-update.

I think we should not change current behavior (default) unless there is a big reason. The current behavior should be the default and the user can use pull_request_branch option to change the default behavior (e.g. branch name set by pull_request_branch will be used to create pull request or force push)

We also need to check if the pull request is already created or not with the users branch and only create pull request if it is not created, otherwise just force push.

src/config.py Outdated Show resolved Hide resolved
@jmlemetayer
Copy link
Contributor Author

Hi @saadmk11,

Did you had time to check the update of the PR ?

Best regards.

@saadmk11
Copy link
Owner

Did you had time to check the update of the PR ?

Sorry, I have been quite busy. I'll try to take a look some time next week.

Copy link
Owner

@saadmk11 saadmk11 left a comment

Choose a reason for hiding this comment

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

Thanks for the updates. I have requested some changes.

We need to update https://github.com/saadmk11/github-actions-version-updater/blob/main/action.yaml with the input option.

src/utils.py Outdated Show resolved Hide resolved
src/main.py Show resolved Hide resolved
src/config.py Outdated Show resolved Hide resolved
src/main.py Show resolved Hide resolved
@jmlemetayer
Copy link
Contributor Author

jmlemetayer commented Nov 22, 2022

Thanks for the updates. I have requested some changes.

I will edit the PR ASAP. Thanks for the review.

We need to update https://github.com/saadmk11/github-actions-version-updater/blob/main/action.yaml with the input option.

I wasn't aware of this file. I will update it as well. Thanks.

@jmlemetayer
Copy link
Contributor Author

We need to update https://github.com/saadmk11/github-actions-version-updater/blob/main/action.yaml with the input option.

Done. I am unsure about the default value. I have set it to 'gh-actions-update-<timestamp>'.

@jmlemetayer
Copy link
Contributor Author

PR updated with the requested changes. In theory it should work.

Do you have any way to test the feature before to merge it ?

@jmlemetayer
Copy link
Contributor Author

Hi @saadmk11,

Quick reminder, could you test and review this PR? You might still be busy.

Best regards,
JM

@saadmk11 saadmk11 changed the base branch from main to pr-branch-config December 16, 2022 08:10
Copy link
Owner

@saadmk11 saadmk11 left a comment

Choose a reason for hiding this comment

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

Hi @jmlemetayer, Thanks for your work on this. For now I am merging the changes to a different branch as I need to do some manual testing.

@saadmk11 saadmk11 merged commit dabae35 into saadmk11:pr-branch-config Dec 16, 2022
@jmlemetayer jmlemetayer deleted the pull-request-branch-config branch December 16, 2022 08:46
@jmlemetayer
Copy link
Contributor Author

Thanks, @saadmk11 I think I can also update one of my project using the action to use the development branch. I will keep you updated.

@jmlemetayer
Copy link
Contributor Author

I have updated my project: https://github.com/jmlemetayer/project-release/

To use:

Also I have add jmlemetayer/project-release@63be594 as a possible workaround of the #49

@jmlemetayer
Copy link
Contributor Author

jmlemetayer commented Dec 28, 2022

Updated my project again, with the fix of the #49.

I let the action run twice, to see the pull request creation and update. Both run are a success:

I have checked manually that the created pull request is correct and also successfully updated:
jmlemetayer/project-release#21

Looks good to me !

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.

Allow to configure the branch name
2 participants