Skip to content

Commit

Permalink
Commit on Existing PRs (#13)
Browse files Browse the repository at this point in the history
* Commit on Existing PRs

* Only PR if BRANCH_EXISTS is set to false
  • Loading branch information
Samq64 authored Dec 19, 2024
1 parent 340c946 commit b348b83
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions scripts/commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,25 @@ git config user.name "scratchaddons-bot[bot]"
if git status | grep -q "git add"; then
echo New strings available. Pushing to GitHub...
BRANCH=tx
git branch -D $BRANCH
git push origin --delete $BRANCH
git checkout -b $BRANCH

if git show-ref --verify --quiet refs/heads/$BRANCH; then
BRANCH_EXISTS=true
git checkout $BRANCH
else
BRANCH_EXISTS=false
git checkout -b $BRANCH
fi

git add _locales/*
git add addons-l10n/*
git commit --no-gpg-sign -m "New strings from Transifex"
git push origin $BRANCH
echo Pushed as $BRANCH

node $GITHUB_ACTION_PATH/scripts/pr.js "$BRANCH"

if [ "$BRANCH_EXISTS" = "false" ]; then
echo "Creating a pull request..."
node $GITHUB_ACTION_PATH/scripts/pr.js "$BRANCH"
else
echo "Skipping PR creation"
fi
fi

0 comments on commit b348b83

Please sign in to comment.