From bb2cbf19cb2032ffe182540b7ff0f87117a819c5 Mon Sep 17 00:00:00 2001 From: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:21:14 +0600 Subject: [PATCH 1/3] Consider not requiring SVN credentials for dry-run --- deploy.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/deploy.sh b/deploy.sh index 22051da..bbac765 100755 --- a/deploy.sh +++ b/deploy.sh @@ -36,18 +36,21 @@ fi # IMPORTANT: while secrets are encrypted and not viewable in the GitHub UI, # they are by necessity provided as plaintext in the context of the Action, # so do not echo or use debug mode unless you want your secrets exposed! -if [[ -z "$SVN_USERNAME" ]]; then - echo "Set the SVN_USERNAME secret" - exit 1 -fi - -if [[ -z "$SVN_PASSWORD" ]]; then - echo "Set the SVN_PASSWORD secret" - exit 1 -fi +# Check if it's a dry-run first if $INPUT_DRY_RUN; then - echo "ℹ︎ Dry run: No files will be committed to Subversion." + echo "ℹ︎ Dry run: No files will be committed to Subversion." +else + # If it's not a dry-run, check for SVN credentials + if [[ -z "$SVN_USERNAME" ]]; then + echo "Set the SVN_USERNAME secret" + exit 1 + fi + + if [[ -z "$SVN_PASSWORD" ]]; then + echo "Set the SVN_PASSWORD secret" + exit 1 + fi fi # Allow some ENV variables to be customized From 89884f1edbd5f8e3e108db7383b5f84ca0aaa150 Mon Sep 17 00:00:00 2001 From: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:39:58 +0600 Subject: [PATCH 2/3] Updated README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eccb113..2980c90 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ This Action commits the contents of your Git tag to the WordPress.org plugin rep ### Inputs * `generate-zip` - Defaults to `false`. Generate a ZIP file from the SVN `trunk` directory. Outputs a `zip-path` variable for use in further workflow steps. -* `dry-run` - Defaults to `false`. Set this to `true` if you want to skip the final Subversion commit step (e.g., to debug prior to a non-dry-run commit). +* `dry-run` - Defaults to `false`. Set this to `true` if you want to skip the final Subversion commit step (e.g., to debug prior to a non-dry-run commit). `dry-run` - `true` Doesn't require SVN secret. ### Outputs From e137dbc4ee9c21579ffa555b327619e51f5fdc6f Mon Sep 17 00:00:00 2001 From: Iftakharul Islam Ifat <88052038+iftakharul-islam@users.noreply.github.com> Date: Sun, 9 Feb 2025 01:03:44 +0600 Subject: [PATCH 3/3] Warning for SVN secrets --- deploy.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deploy.sh b/deploy.sh index bbac765..70aac3b 100755 --- a/deploy.sh +++ b/deploy.sh @@ -40,6 +40,14 @@ fi # Check if it's a dry-run first if $INPUT_DRY_RUN; then echo "ℹ︎ Dry run: No files will be committed to Subversion." + + if [[ -z "$SVN_USERNAME" ]]; then + echo "Warning: SVN_USERNAME is missing. The commit will fail if you attempt a real run." + fi + + if [[ -z "$SVN_PASSWORD" ]]; then + echo "Warning: SVN_PASSWORD is missing. The commit will fail if you attempt a real run." + fi else # If it's not a dry-run, check for SVN credentials if [[ -z "$SVN_USERNAME" ]]; then