-
Notifications
You must be signed in to change notification settings - Fork 0
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: Add strategy selection to dependabot automerge workflow #219
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
The PR looks already good but would be nice to fix the linting action. 🙌 |
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.
thanks for merging my first suggestion so fast. I wasn't even able to comment on it :-)
But I want to discuss another point.
Do we really need the eval
command.
Can we not refactor it in that way
pseudo code
MERGE_OPTIONS=''
if [ "${{ inputs.rebase }}" == 'true' ]; then
MERGE_OPTIONS+=" --rebase"
else
MERGE_OPTIONS+=" --squash"
fi
if [ ${{ inputs.force }} == 'true' ]; then
MERGE_OPTIONS+=" --admin"
fi
else
MERGE_OPTIONS+=" --auto --merge"
fi
echo "Executing merge command with the options: '${MERGE_OPTIONS}'"
gh pr merge "$PR_URL" "${MERGE_OPTIONS}"
@soemo I really liked the concise approach you proposed 🙁 We don't need the But there is a concern here with the merge method: if [ "${{ inputs.rebase }}" == 'true' ]; then
MERGE_OPTIONS+=" --rebase"
else
MERGE_OPTIONS+=" --squash"
fi
if [ "${{ inputs.force }}" == 'true' ]; then
MERGE_OPTIONS+=" --admin"
else
MERGE_OPTIONS+=" --auto --merge"
fi With Should I change the input to select the strategy instead of a boolean between |
That is a nice idea 👍 to have a strategy as input. If we set squash as default, the new code will be get much easier |
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.
Really nice improvement! 🎉
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.
LGTM, but it would be great to test it in action before merging
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.
Hey @ingvaar !
The action ran into a problem in the lambda-edge-secure-media repo:
https://github.com/Staffbase/lambda-edge-secure-media/actions/runs/7867783102/job/21467013254?pr=91
4f5e3a1
to
9eb1042
Compare
How we move on with this PR? |
We need to test it after the last change. |
We will test it in one of our repos with the next minor bump of a dependency. /cc @ingvaar |
We again have to wait for suitable dependabot PR matching the condition: https://github.com/Staffbase/gha-workflows/blob/main/.github/workflows/template_automerge_dependabot.yml#L39 We'll run dependabot over the week to hopefully soon have some. |
Good news: Finally, there was a dependbat PR to test this. https://github.com/Staffbase/media-analytics/actions/runs/8223143665/job/22485477812?pr=87 Edit: I am on it! |
The most recent version (HEAD of this brach => d43d6f6) of the action is not used in https://github.com/Staffbase/media-analytics/pull/87. Most likely due to caching... |
4065e05
to
ff8cf9e
Compare
Here a successful run: https://github.com/Staffbase/media-analytics/actions/runs/8224375573/job/22488121540?pr=87 This is the dependabot PR for testing: https://github.com/Staffbase/media-analytics/pull/87 @flaxel I think the force option never worked before 😅 : ff8cf9e |
Co-authored-by: Sören Mothes <[email protected]>
also update README
e22cbda
to
9ffaa3d
Compare
I clarified this in a call with Falk. My assumption was based on a change which was introduced in this PR before I took over 😅. So, on main the action was never broken. |
Type of Change
Description
This PR adds a
strategy
option to dependabot automerge workflow.It allows to select the merge strategy. The possible options are:
rebase
merge
squash
(default)Checklist