-
Notifications
You must be signed in to change notification settings - Fork 4
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(automate): automate version bump for pre-commit repo #12
Conversation
6ead1d0
to
a2d5182
Compare
.github/workflows/tag-version.yaml
Outdated
on: | ||
push: | ||
branches: | ||
- develop |
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.
What would happen here if we make multiple commits on a given version?
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.
The thought behind this workflow is that it is ran only after the bump version workflow's PR is merged which is just one single squashed merge commit; I'm not sure if there is any more invariants I should be concerned about in this repo:
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.
( am still trying to debug this workflow as for some reason it does not trigger after an auto merge, at least thats what I saw in the test-pre-commit repo)
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.
Alright I've deleted this workflow: the way this is automated now is
bump_version.yml
: Commits on a branch, pushes the branch & tags a commit on the branchautoapprove.yml
: If PR is made by semgrep-ci[bot], approve & wait for checks to pass; then auth as semgrep-ci[bot], move the tag to develop. (delete the tag made on the branch, then push a tag on develop)
Co-authored-by: Cooper Pierce <[email protected]>
* Add work from other fork * Hardcode configs + remove inc * adding remotes command * going to version 2 of checkout * using version 4 of checkout * using with submodules: true * remove fake reviwer` * add gh token * aaa * Add autoapprove bot * Remove approvals and merge from bump_version * remove bogus reviewer * wack script * Fix bump ver * Restore state? * change name * fix typo * Bump setup to 1.82.0 * Bump pre-commit yaml to 1.81.0 (#16) Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com> * Bump pre-commit yaml to 1.84.1 (#18) Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com> * Bump setup to 1.33.22 (#19) Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com> * simplify workflow * Make 2nd step its own workflow * no dup name * maybe fix error * remove dup key * don't hardcode bump yaml * Bump setup to 3.33.3 (#21) Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com> * Change trigger hook * Bump setup to 2.22.2 (#22) Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com> * remove dispatch * try on:push * Bump setup to 3.33.3 (#23) Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com> * Bump setup to 1.84.1 (#24) Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com> * push a tag * make sed portable * reset version * commit all files * Bump setup to 1.84.1 (#26) Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com> * Cooper edit * sync * actually get token * perms * Bump setup to 1.84.0 (#29) Co-authored-by: yosefAlsuhaibani <[email protected]> * Don't negate? * Bump setup to 1.84.1 (#30) Co-authored-by: yosefAlsuhaibani <[email protected]> * escape properlly? * Bump setup to 1.84.0 (#31) Co-authored-by: yosefAlsuhaibani <[email protected]> * remove conditional * Bump setup to 1.84.1 (#32) Co-authored-by: yosefAlsuhaibani <[email protected]> * add back conditional * fake file * Change ext * Bump setup to 1.84.0 (#34) Co-authored-by: yosefAlsuhaibani <[email protected]> * Update autoapprove? * Fix checks * add --squash * del tag and tag * Bump setup to 1.84.1 (#37) Co-authored-by: yosefAlsuhaibani <[email protected]> * add ref: develop * Bump setup to 1.84.0 (#38) Co-authored-by: yosefAlsuhaibani <[email protected]> * Bump setup to 1.84.1 (#39) Co-authored-by: yosefAlsuhaibani <[email protected]> * Remove tag-version script and workflow * Add a small comment why we change ids * Don't push bogus changes * bogus --------- Co-authored-by: Yosef Alsuhaibani <[email protected]> Co-authored-by: Andre Kuhlenschmidt <[email protected]> Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com> Co-authored-by: semgrep-ci[bot] <106279034+semgrep-ci[bot]@users.noreply.github.com> Co-authored-by: yosefAlsuhaibani <[email protected]>
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.
Looks good to me. Add a comment showing where it is used in the semgrep repo.
jobs: | ||
approve-bot: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.pull_request.user.login == 'semgrep-ci[bot]'}} |
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.
Since this always triggers for semgrep-ci[bot]
, let's just keep in mind we may need to narrow this to also require the PR title is chore: release
or whatever if we run into additional cases we want this bot to make a PR here. Seems fine for now though.
Automate step 7 from the semgrep release/rollback guide Closes SAF-1468.
Closes #1.