Skip to content

Commit 75545db

Browse files
committed
restore files, whether overriding or not
1 parent f793ce1 commit 75545db

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

java/ql/automodel/publish.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,19 @@ popd
158158
# This will be the file for the new release
159159
NEW_CHANGE_NOTES_FILE=$(ls -t ./src/change-notes/released/*.md | head -n 1)
160160

161+
# Make a copy of the modified files
161162
mv ./src/CHANGELOG.md ./src/CHANGELOG.md.dry-run
162163
mv ./src/codeql-pack.release.yml ./src/codeql-pack.release.yml.dry-run
163164
mv ./src/qlpack.yml ./src/qlpack.yml.dry-run
164165
mv "$NEW_CHANGE_NOTES_FILE" ./src/change-notes/released.md.dry-run
165166

166-
# If --override-release was not specified, then we need to checkout the original branch
167-
if [ $OVERRIDE_RELEASE != 1 ]; then
168-
echo "Checking out the original branch"
167+
if [ $OVERRIDE_RELEASE = 1 ]; then
168+
# Restore the original files
169+
git checkout ./src/CHANGELOG.md
170+
git checkout ./src/codeql-pack.release.yml
171+
git checkout ./src/qlpack.yml
172+
else
173+
# Restore the original files
169174
git checkout "$CURRENT_BRANCH" --force
170175
fi
171176

0 commit comments

Comments
 (0)