Skip to content

Commit 5b325a1

Browse files
authored
Merge pull request #164 from iftakharul-islam/develop
Consider not requiring SVN credentials for dry-run
2 parents 210430b + e137dbc commit 5b325a1

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This Action commits the contents of your Git tag to the WordPress.org plugin rep
2929
### Inputs
3030

3131
* `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.
32-
* `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).
32+
* `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.
3333

3434
### Outputs
3535

deploy.sh

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,29 @@ fi
3636
# IMPORTANT: while secrets are encrypted and not viewable in the GitHub UI,
3737
# they are by necessity provided as plaintext in the context of the Action,
3838
# so do not echo or use debug mode unless you want your secrets exposed!
39-
if [[ -z "$SVN_USERNAME" ]]; then
40-
echo "Set the SVN_USERNAME secret"
41-
exit 1
42-
fi
43-
44-
if [[ -z "$SVN_PASSWORD" ]]; then
45-
echo "Set the SVN_PASSWORD secret"
46-
exit 1
47-
fi
4839

40+
# Check if it's a dry-run first
4941
if $INPUT_DRY_RUN; then
50-
echo "ℹ︎ Dry run: No files will be committed to Subversion."
42+
echo "ℹ︎ Dry run: No files will be committed to Subversion."
43+
44+
if [[ -z "$SVN_USERNAME" ]]; then
45+
echo "Warning: SVN_USERNAME is missing. The commit will fail if you attempt a real run."
46+
fi
47+
48+
if [[ -z "$SVN_PASSWORD" ]]; then
49+
echo "Warning: SVN_PASSWORD is missing. The commit will fail if you attempt a real run."
50+
fi
51+
else
52+
# If it's not a dry-run, check for SVN credentials
53+
if [[ -z "$SVN_USERNAME" ]]; then
54+
echo "Set the SVN_USERNAME secret"
55+
exit 1
56+
fi
57+
58+
if [[ -z "$SVN_PASSWORD" ]]; then
59+
echo "Set the SVN_PASSWORD secret"
60+
exit 1
61+
fi
5162
fi
5263

5364
# Allow some ENV variables to be customized

0 commit comments

Comments
 (0)