From fe553c71730fe25523081c16fbdb402cbcfb2a13 Mon Sep 17 00:00:00 2001 From: Ludy Date: Tue, 24 Jun 2025 00:05:38 +0200 Subject: [PATCH] ci: add cleanup step to remove temporary files in workflow (#3782) # Description of Changes # Description of Changes - Added a new step `Cleanup temporary files` at the end of the `check_properties.yml` GitHub Actions workflow. - This step ensures temporary files such as `pr-branch`, `.properties` comparison files, and result artifacts are deleted after the job. - The `continue-on-error: true` flag guarantees cleanup runs even if previous steps fail. This change helps prevent workspace clutter and reduces disk usage in CI runs. --- ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details. --- .github/workflows/check_properties.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/check_properties.yml b/.github/workflows/check_properties.yml index c1032d00c..7c2c075b3 100644 --- a/.github/workflows/check_properties.yml +++ b/.github/workflows/check_properties.yml @@ -269,3 +269,12 @@ jobs: run: | echo "Failing the job because errors were detected." exit 1 + + - name: Cleanup temporary files + if: always() + run: | + echo "Cleaning up temporary files..." + rm -rf pr-branch + rm -f pr-branch-messages_en_GB.properties main-branch-messages_en_GB.properties changed_files.txt result.txt + echo "Cleanup complete." + continue-on-error: true # Ensure cleanup runs even if previous steps fail \ No newline at end of file