From 7a1f977955b7d9d94267ea25cbea49eefa6ae9ec Mon Sep 17 00:00:00 2001 From: KubaZ2 Date: Sat, 8 Nov 2025 18:26:27 +0100 Subject: [PATCH] Refactor to use environment variable for PR number Replaced direct use of `${{ github.event.pull_request.number }}` with the `PULL_REQUEST_NUMBER` environment variable for improved readability and reusability. Added `envs` and `env` sections to define and declare the `PULL_REQUEST_NUMBER` variable, ensuring it is accessible during job execution. This change simplifies debugging and enhances maintainability. --- .github/workflows/cleanup-documentation-preview.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cleanup-documentation-preview.yml b/.github/workflows/cleanup-documentation-preview.yml index aaf584e2..e1646059 100644 --- a/.github/workflows/cleanup-documentation-preview.yml +++ b/.github/workflows/cleanup-documentation-preview.yml @@ -20,4 +20,7 @@ jobs: host: ${{ secrets.SSH_HOST }} port: ${{ secrets.SSH_PORT }} key: ${{ secrets.SSH_KEY }} - script: rm -rf ~/NetCord/preview/html/${{ github.event.pull_request.number }} + script: rm -rf ~/NetCord/preview/html/$PULL_REQUEST_NUMBER + envs: PULL_REQUEST_NUMBER + env: + PULL_REQUEST_NUMBER: "${{ github.event.pull_request.number }}"