Skip to content

Commit

Permalink
Respect ShellCheck and sprinkle some Markdown on it
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ferraz-oliveira committed Oct 16, 2023
1 parent 70d8b72 commit 2637b0a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/rebar3_depup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,26 @@ git config user.email "[email protected]"

BRANCH=feature/rebar3-depup-updates

if git branch -a | grep "$BRANCH" > /dev/null; then
if git branch -a | grep "${BRANCH}" >/dev/null || true; then
# already exists
exit
fi

git fetch origin
git checkout -b "$BRANCH"
mkdir -p "$HOME/.config/rebar3"
echo "{plugins, [rebar3_depup]}." > "$HOME/.config/rebar3/rebar.config"
git checkout -b "${BRANCH}"
mkdir -p "${HOME}/.config/rebar3"
echo "{plugins, [rebar3_depup]}." >"${HOME}/.config/rebar3/rebar.config"
rebar3 up

if ! git diff --exit-code 1> /dev/null ; then
if ! git diff --exit-code 1>/dev/null; then
TITLE="[automation] Update \`rebar.config\` versions (via \`rebar3 depup\`)"

# there's stuff to push
git add rebar.config
git commit -m "Update rebar.config versions (rebar3 depup)"
git push origin "$BRANCH"
git commit -m "${TITLE}"
git push origin "${BRANCH}"

gh pr create --fill \
--title "Update rebar.config versions with rebar3_depup (automation)" \
--title "${TITLE}" \
--body "This is an automated action to update the repositories rebar.config versions"
fi

0 comments on commit 2637b0a

Please sign in to comment.