Skip to content

Commit

Permalink
Merge pull request #164 from iftakharul-islam/develop
Browse files Browse the repository at this point in the history
Consider not requiring SVN credentials for dry-run
  • Loading branch information
iamdharmesh authored Feb 10, 2025
2 parents 210430b + e137dbc commit 5b325a1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
31 changes: 21 additions & 10 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,29 @@ 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."

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
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
Expand Down

0 comments on commit 5b325a1

Please sign in to comment.