astoltz/SourceGuardian Action

Protects PHP scripts by compiling them with SourceGuardian.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Maintainedlast commit Dec 13, 2025
License
None

Pinned Snippet

workflow.ymlSHA-pinned
uses: astoltz/sourceguardian-encode-action@f88fea564ba42968ecfcc0e8cecf791a9a408c8b # no releases — HEAD as of 2026-07-13

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
sourceThe source directory or file mask to process (e.g., "src", "src/*.php").yes
destinationThe output directory for encoded files. Source files remain unchanged.yes
sourceguardian_pathThe directory containing the sourceguardian executable. Defaults to searching the system PATH.no
phpversionA multiline list of PHP versions to compile for (e.g., 8.3, 7.4+). Defaults to 8.3.no8.3
expireExpiration date (dd/mm/yyyy) or period from now (e.g., 10d, 1d12h, 90m).no
domainA multiline list of domain names to bind the script to. Cannot be used with `domain-encrypt`.no
domain-encryptBind and encrypt script to a single domain name. Cannot be used with `domain`.no
domain-ignore-cliIgnore domain name check for CLI.nofalse
ipA multiline list of IP addresses/masks to bind the script to. Cannot be used with `ip-encrypt`.no
ip-encryptBind and encrypt script to a single IP address/mask. Cannot be used with `ip`.no
ip-ignore-cliIgnore IP check for CLI.nofalse
macA multiline list of MAC addresses to bind the script to.no
machine-idA multiline list of machine IDs to bind the script to. Cannot be used with `machine-id-encrypt`.no
machine-id-encryptBind and encrypt script to a single machine ID. Cannot be used with `machine-id`.no
remote-verification-urlURL for remote machine ID verification for CLI scripts.no
externalComma-separated list of license filenames, paths, or URLs. Requires `projid` and `projkey`. Cannot be used with other locking options.no
conjMake scripts work only with other encoded files.nofalse
projidProject ID. Required when using `external`.no
projkeyProject Key. Required when using `external`. Use a GitHub secret.no
time-serverComma-separated list of time servers for expiration checks (e.g., "pool.ntp.org,time.nist.gov").no
constA multiline list of custom defined constants (e.g., "name=value").no
catchA multiline list of custom error handlers (e.g., "ERR_EXPIRED=my_handler").no
auto-globalA multiline list of custom auto-global variable names.no
asp-tagsEnable the use of ASP-like <% %> tags.nofalse
no-short-tagsDisable the use of short PHP <? ?> tags.nofalse
prepend-codeCustom header code to add to the top of every encoded file (e.g., "code" or "@file.php").no
loader-error-codeCustom code to execute if the SourceGuardian loader is not found (e.g., "code" or "@file.php").no
no-default-starterDo not integrate the default starter code for loader discovery.nofalse
compression-levelCompression level from 0 (fastest) to 9 (maximum).no
entanglePRO Entangling mode X with granularity Y (e.g., "7" or "7,4").no
compatEnable PHP 8.4+ compatibility mode.nofalse
eval-compatibleEnable eval() compatibility for encoded scripts.nofalse
stop-on-errorStop encoding on the first critical error.nofalse
strict-errorsReport E_STRICT compiler errors.nofalse
deprec-errorsReport E_DEPRECATED PHP 5.3+ compiler errors.nofalse
keep-file-dateKeep the original modification date for encoded files.nofalse
keep-doc-commentsKeep doc comments within encoded files.nofalse
backupSet backup file extension (e.g., "bak") or set to `false` to disable backups.no
recursiveRecursively process files. Set to `false` to disable. Set to a number > 0 to strip that many directories from the target path.no0
files_to_excludeA multiline list of file masks to exclude from processing entirely.no
files_to_encodeA multiline list of file masks to encode as PHP. If used, other files matching the source are copied as-is.no
files_to_encode_as_customA multiline list of file masks to encode as custom non-PHP files.no
files_to_copyA multiline list of file masks to copy without encoding.no
encode-newer-thanOnly encode files newer than the specified date/time (YYYYMMDDhhmmss).no
ignore-symlinksIgnore symlinks while recursively scanning directories.nofalse
verboseSet verbosity level: 0 (quiet), 1 (errors only), 2 (encoding log).no2
docker-socketPath to the mapped docker socket for installing to a Docker container.no
license-filePath to the license file.no
show-license-infoOutput license information after encoding.notrue
license-releaseRelease the license for this installation after encoding. Cannot be used with `license-dynamic`.nofalse
license-dynamicRequest a dynamic license. Requires username and password.nofalse
license-usernameThe username for a dynamic license request.no
license-passwordThe password for a dynamic license request. Use a GitHub secret.no
namedescription
sourceguardian_versionThe version of the SourceGuardian encoder used.
sourceguardian_licenseThe license information for the SourceGuardian installation.