This commit is contained in:
Stephan 2021-06-10 17:21:24 +02:00
parent 62a110b9b1
commit ddb5f03cb1

View File

@ -24,44 +24,3 @@ jobs:
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
- name: Report
shell: bash
run: |
set +e
git log --graph --pretty=format':%h%%d %s %an, %ar' | head -n 5
echo "--"
REF="${{ github.ref }}"
BRANCH=${REF#refs/heads/}
if [ "$BRANCH" != "$REF" ]; then
VERSION=${BRANCH#release/}
if [ "$VERSION" != "$BRANCH" ]; then
echo "Triggered by commit in version $VERSION release branch $BRANCH"
git fetch origin wip-$VERSION:wip-$VERSION
if [ $? -ne 0 ]; then
echo "Tag v$VERSION does not exist"
else
TAGSHA=$(git rev-parse wip-$VERSION)
echo "FOUND TAG $TAGSHA"
if [ "$TAGSHA" != "${{ github.sha }}" ]; then
echo "TAG v$VERSION exists on another commit : error"
exit 1
else
echo "Tag v$VERSION exists on this commit: nothing to do here"
fi
fi
else
echo "Triggered by commit in non-release branch $BRANCH: error"
exit 1
fi
exit 0
fi
TAG=${REF#refs/tags/}"
if [ "$TAG" != "$REF" ]; then
echo "Triggered by tag $TAG"
exit 0
fi
echo "ERR"
exit 1