Skip to content

Instantly share code, notes, and snippets.

View c0m1c5an5's full-sized avatar

c0m1c5an5 c0m1c5an5

  • Ukraine, Kyiv
View GitHub Profile
@c0m1c5an5
c0m1c5an5 / README.md
Last active March 19, 2025 18:28
Git wrapper to allow semantic-release to work when HEAD is behind remote.

I highly recommend using python-semantic-release instead. It provides full control over the release creation and does not have roadblocks in place preventing you from using it on non-latest commits. Still, if using semantic-release is a must, above scripts provide the means to do so.

@c0m1c5an5
c0m1c5an5 / slugify.sh
Last active April 28, 2025 15:12
GitLab CI Slugify Implementation Pure Bash
# Implementation of https://gitlab.com/gitlab-org/gitlab/-/blob/master/gems/gitlab-utils/lib/gitlab/utils.rb#L56
slugify() {
local reply
unset REPLY ERR
reply="${*,,}"
reply="${reply//[^a-z0-9]/-}"
reply="${reply:0:63}"
while [[ ${reply} == -* ]]; do reply="${reply#-}"; done
while [[ ${reply} == *- ]]; do reply="${reply%-}"; done