Skip to content

Commit 950e019

Browse files
committed
Fix Update.Unturned.Redist do not stop on exit 0
1 parent 69259ee commit 950e019

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

.github/workflows/Update.Unturned.Redist.yaml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,8 @@ jobs:
165165
echo "manifest_changed=false" >> $GITHUB_OUTPUT
166166
fi
167167
168-
- name: Skip unchanged manifest
169-
if: steps.compare_manifest.outputs.manifest_changed != 'true'
170-
run: |
171-
echo "No manifest changes for ${{ matrix.variant }}. Skipping update steps."
172-
exit 0
173-
174168
- name: Download update tool
169+
if: steps.compare_manifest.outputs.manifest_changed == 'true'
175170
uses: robinraju/release-downloader@v1
176171
with:
177172
repository: RocketModFix/UnturnedRedistUpdateTool
@@ -181,9 +176,11 @@ jobs:
181176
extract: true
182177

183178
- name: Setup SteamCMD
179+
if: steps.compare_manifest.outputs.manifest_changed == 'true'
184180
uses: CyberAndrii/setup-steamcmd@v1
185181

186182
- name: Update game files
183+
if: steps.compare_manifest.outputs.manifest_changed == 'true'
187184
run: |
188185
if [[ "$APP_BRANCH_NAME" == "" ]]; then
189186
steamcmd +force_install_dir $GITHUB_WORKSPACE +login ${{ secrets.STEAM_USERNAME }} ${{ secrets.STEAM_PASSWORD }} +app_update $APP_ID -validate +quit
@@ -192,6 +189,7 @@ jobs:
192189
fi
193190
194191
- name: Run redist updater
192+
if: steps.compare_manifest.outputs.manifest_changed == 'true'
195193
run: |
196194
flags=""
197195
@@ -218,32 +216,26 @@ jobs:
218216
dotnet redist_tool/UnturnedRedistUpdateTool.dll "$GITHUB_WORKSPACE" "$GITHUB_WORKSPACE/$REDIST_DIR" "$APP_ID" $flags
219217
220218
- name: Generate Commit Message
219+
if: steps.compare_manifest.outputs.manifest_changed == 'true'
221220
run: |
222221
msg=$( cat .commit )
223222
echo "message=$msg" >> "$GITHUB_OUTPUT"
224223
id: generate_commit_message
225224

226-
- name: Check for changes
227-
id: check_changes
228-
run: |
229-
if git diff --quiet; then
230-
echo "has_changes=false" >> $GITHUB_OUTPUT
231-
echo "No changes detected for ${{ matrix.variant }}"
232-
else
233-
echo "has_changes=true" >> $GITHUB_OUTPUT
234-
echo "Changes detected for ${{ matrix.variant }}"
235-
fi
236-
237-
- name: Final check for changes
225+
- name: Check for git changes
226+
if: steps.compare_manifest.outputs.manifest_changed == 'true'
227+
id: check_git_changes
238228
run: |
239229
if git diff --quiet; then
240-
echo "No changes detected after all processing for ${{ matrix.variant }}. Exiting."
241-
exit 0
230+
echo "No changes detected after all processing for ${{ matrix.variant }}."
231+
echo "has_git_changes=false" >> $GITHUB_OUTPUT
242232
else
243233
echo "Changes detected after all processing for ${{ matrix.variant }}"
234+
echo "has_git_changes=true" >> $GITHUB_OUTPUT
244235
fi
245236
246237
- name: Create Pull Request
238+
if: steps.compare_manifest.outputs.manifest_changed == 'true' && steps.check_git_changes.outputs.has_git_changes == 'true'
247239
id: create_pr
248240
uses: peter-evans/create-pull-request@v7
249241
with:
@@ -283,10 +275,17 @@ jobs:
283275
run: |
284276
echo "## Update Summary for ${{ matrix.variant }}" >> $GITHUB_STEP_SUMMARY
285277
echo "- **Branch**: \`${{ env.BRANCH_NAME }}\`" >> $GITHUB_STEP_SUMMARY
286-
echo "- **Has Changes**: ${{ steps.check_changes.outputs.has_changes }}" >> $GITHUB_STEP_SUMMARY
287-
if [[ "${{ steps.check_changes.outputs.has_changes }}" == "true" ]]; then
288-
echo "- **PR Created**: #${{ steps.create_pr.outputs.pull-request-number }}" >> $GITHUB_STEP_SUMMARY
289-
echo "- **PR URL**: ${{ steps.create_pr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY
278+
echo "- **Manifest Changed**: ${{ steps.compare_manifest.outputs.manifest_changed }}" >> $GITHUB_STEP_SUMMARY
279+
if [[ "${{ steps.compare_manifest.outputs.manifest_changed }}" == "true" ]]; then
280+
echo "- **Git Changes**: ${{ steps.check_git_changes.outputs.has_git_changes }}" >> $GITHUB_STEP_SUMMARY
281+
if [[ "${{ steps.check_git_changes.outputs.has_git_changes }}" == "true" ]]; then
282+
echo "- **PR Created**: #${{ steps.create_pr.outputs.pull-request-number }}" >> $GITHUB_STEP_SUMMARY
283+
echo "- **PR URL**: ${{ steps.create_pr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY
284+
else
285+
echo "- **Status**: No git changes detected after processing" >> $GITHUB_STEP_SUMMARY
286+
fi
287+
else
288+
echo "- **Status**: Skipped (no manifest changes)" >> $GITHUB_STEP_SUMMARY
290289
fi
291290
292291
workflow-keepalive:

0 commit comments

Comments
 (0)