BioDrop icon indicating copy to clipboard operation
BioDrop copied to clipboard

Change workflows to not push to main directly.

Open mocdaniel opened this issue 2 years ago • 5 comments

Fixes Issue

Closes #2756

Changes proposed

  • [X] Changes workflow releases.yml to not push to main directly. More info below.

Check List (Check all the applicable boxes)

  • [X] My code follows the code style of this project.
  • [ ] My change requires changes to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [X] All new and existing tests passed.
  • [X] This PR does not contain plagiarized content.
  • [X] The title of my pull request is a short description of the requested changes.

Screenshots

Note to reviewers

The proposed changes to the actions which are currently pushing to main follow the same pattern:

  1. Instead of pushing to main, push to a uniquely named, new branch, e.g. release-from-<commit-sha>.
  2. Create a PR using the gh CLI tool which is installed and usable on all managed GitHub runners (see here).
  3. Merge this PR using the gh CLI tool and a token which authorizes the action to do the merge. In the current draft, a merge commit is used and the merge gets forced, i.e. pending/failed actions are ignored via the --admin flag.
  4. Continue with the remaining, existing steps, as all changes are now once again in main.
  5. Be happy about green squares and a neat collaboration experience. 🥳

@eddiejaoude @loftwah what do you think about this proposed strategy?

mocdaniel avatar Jan 07 '23 11:01 mocdaniel

I think since the release action will be modifying the changelog file on main it might have issues as well. The action currently used to create the release is unmaintained, so it could present a problem. See issue #2243

dan-mba avatar Jan 07 '23 12:01 dan-mba

I worked it out, I think. I commented all involved steps for better documentation of what is actually happening, see also this action log as proof of concept:

https://github.com/mocdaniel/action-test/actions/runs/3862144796/jobs/6583557437

mocdaniel avatar Jan 07 '23 12:01 mocdaniel

Btw your test 2 PR has conflicts, is that for another reason?

eddiejaoude avatar Jan 07 '23 14:01 eddiejaoude

Btw your test 2 PR has conflicts, is that for another reason?

Yes, that's because several 'release branches' exist(ed) at the same time due to the action not working at that point of time. Now that everything works, there will never be competing 'release branches', so this shouldn't be a problem, really.

mocdaniel avatar Jan 08 '23 10:01 mocdaniel

This combination of workflows does its job now, but for some reason I couldn't figure out it created empty changelogs for me. We might have to test this a bit more, or maybe one of you knows why this is happening.

mocdaniel avatar Jan 08 '23 12:01 mocdaniel