Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ inputs:
description: The file containing arguments to pass to acme.sh (will be prepended to all `-d domain.name` items). The first argument `--issue` should be omitted. For example `--dns dns_cf --challenge-alias example.com`. Overrides `arguments` field.
required: false
default: ''
arguments-install:
description: The arguments to pass to acme.sh to `install-cert`.
required: false
default: ''
output-fullchain:
description: The target path for the issued certificate's fullchain PEM file. Omit if you don't need.
required: false
Expand Down Expand Up @@ -144,7 +148,7 @@ runs:
ACME_SH_TEMP_DIR="$(mktemp -d)"
ACME_SH_TEMP_FILE_FULLCHAIN="$ACME_SH_TEMP_DIR/fullchain.pem"
ACME_SH_TEMP_FILE_KEY="$ACME_SH_TEMP_DIR/key.pem"
~/.acme.sh/acme.sh --install-cert -d "$ACME_SH_FIRST_DOMAIN" --fullchain-file "$ACME_SH_TEMP_FILE_FULLCHAIN" --key-file "$ACME_SH_TEMP_FILE_KEY"
~/.acme.sh/acme.sh --install-cert -d "$ACME_SH_FIRST_DOMAIN" --fullchain-file "$ACME_SH_TEMP_FILE_FULLCHAIN" --key-file "$ACME_SH_TEMP_FILE_KEY" "$ACME_SH_INPUT_INSTALL_ARGS_PREPENDED"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't be wrapped with double quotes, or multiple arguments splitted with spaces will be treat as one argument.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, since it's in the end of the argument list, it should be named "appended" instead of "prepended".

[[ -z "$ACME_SH_OUTPUT_FULLCHAIN" ]] || (mkdir -p "$(dirname "$ACME_SH_OUTPUT_FULLCHAIN")" && cp "$ACME_SH_TEMP_FILE_FULLCHAIN" "$ACME_SH_OUTPUT_FULLCHAIN")
[[ -z "$ACME_SH_OUTPUT_KEY" ]] || (mkdir -p "$(dirname "$ACME_SH_OUTPUT_KEY")" && cp "$ACME_SH_TEMP_FILE_KEY" "$ACME_SH_OUTPUT_KEY")
[[ -z "$ACME_SH_OUTPUT_PFX" ]] || (mkdir -p "$(dirname "$ACME_SH_OUTPUT_PFX")" && (
Expand All @@ -161,6 +165,7 @@ runs:
ACME_SH_OUTPUT_KEY: ${{ inputs.output-key }}
ACME_SH_OUTPUT_PFX: ${{ inputs.output-pfx }}
ACME_SH_OUTPUT_PFX_PASSWORD: ${{ inputs.output-pfx-password }}
ACME_SH_INPUT_INSTALL_ARGS_PREPENDED: ${{ inputs.arguments-install }}
- name: Uninstall acme.sh
if: ${{ inputs.uninstall != 'false' }}
run: |
Expand Down