File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,8 +102,13 @@ jobs:
102102 # Count the total commits for this branch
103103 run : |
104104 revision="v$(($(git rev-list --count HEAD) + ${{ inputs.revision-offset }}))"
105- git tag $revision
106- git push -u origin $revision
105+ if [ $(git tag | grep '^'"$revision"'$' | wc -l) -eq 0 ]; then
106+ git tag $revision
107+ git push -u origin $revision
108+ elif [ $(git diff ${{ github.sha }}..$revision --name-only | wc -l) -ne 0 ]; then
109+ echo "Already existing tag pointing to different revision"
110+ exit 1
111+ fi
107112 echo "revision=$revision" >> $GITHUB_OUTPUT
108113
109114 plugin-build :
@@ -158,7 +163,9 @@ jobs:
158163 - name : Build with maven
159164 if : ${{ hashFiles(format('josm/plugins/{0}/pom.xml', inputs.plugin-directory)) != '' }}
160165 run : |
166+ set -ex
161167 cd $GITHUB_WORKSPACE/josm/plugins/${{ inputs.plugin-directory }}
168+ ls ../../core/tools/checkstyle
162169 mvn --file ../../core/pom.xml package install -DskipTests
163170 mvn --file pom.xml package javadoc:jar source:jar -DskipTests -Dplugin.dist.dir=../../dist -Dplugin.version=${{ steps.version.outputs.version }}
164171 mv target/${{ inputs.plugin-jar-name }}-*-sources.jar ../../dist/${{ inputs.plugin-jar-name }}-sources.jar
Original file line number Diff line number Diff line change @@ -102,8 +102,13 @@ jobs:
102102 # Count the total commits for this branch
103103 run : |
104104 revision="v$(($(git rev-list --count HEAD) + ${{ inputs.revision-offset }}))"
105- git tag $revision
106- git push -u origin $revision
105+ if [ $(git tag | grep '^'"$revision"'$' | wc -l) -eq 0 ]; then
106+ git tag $revision
107+ git push -u origin $revision
108+ elif [ $(git diff ${{ github.sha }}..$revision --name-only | wc -l) -ne 0 ]; then
109+ echo "Already existing tag pointing to different revision"
110+ exit 1
111+ fi
107112 echo "revision=$revision" >> $GITHUB_OUTPUT
108113
109114 plugin-build :
@@ -158,7 +163,9 @@ jobs:
158163 - name : Build with maven
159164 if : ${{ hashFiles(format('josm/plugins/{0}/pom.xml', inputs.plugin-directory)) != '' }}
160165 run : |
166+ set -ex
161167 cd $GITHUB_WORKSPACE/josm/plugins/${{ inputs.plugin-directory }}
168+ ls ../../core/tools/checkstyle
162169 mvn --file ../../core/pom.xml package install -DskipTests
163170 mvn --file pom.xml package javadoc:jar source:jar -DskipTests -Dplugin.dist.dir=../../dist -Dplugin.version=${{ steps.version.outputs.version }}
164171 mv target/${{ inputs.plugin-jar-name }}-*-sources.jar ../../dist/${{ inputs.plugin-jar-name }}-sources.jar
You can’t perform that action at this time.
0 commit comments