Skip to content

Commit 330db0b

Browse files
authored
fix independently-packaged modules being tagged by checking for tag existence before push (#262)
1 parent e4f7c2d commit 330db0b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/push-release-tag.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ jobs:
3838
- run: |
3939
for working_copy in $(ls -d repositories/*/.git); do
4040
cd $(dirname $working_copy)
41+
# Check if the remote is a mage-os org repository
4142
if git remote -v | grep -qE 'https://github.com/mage-os/'; then
4243
echo Processing repository $(basename $(pwd))
43-
ORIG=$(git remote -v | grep push | awk '{print $2}')
44-
NEW=${ORIG/https:\/\/github.com/https:\/\/mage-os-ci:${{ env.github_pat }}@github.com}
45-
git push $NEW "${{ env.mageos_release }}"
44+
# Check if the tag exists before pushing
45+
if git rev-parse "${{ env.mageos_release }}" >/dev/null 2>&1; then
46+
ORIG=$(git remote -v | grep push | awk '{print $2}')
47+
NEW=${ORIG/https:\/\/github.com/https:\/\/mage-os-ci:${{ env.github_pat }}@github.com}
48+
git push $NEW "${{ env.mageos_release }}"
49+
fi
4650
fi
4751
cd -
4852
done

0 commit comments

Comments
 (0)