mit einem Klick
ci-act-run
// Run the full build-and-deploy.yaml workflow locally via act + Docker. Supports pull_request and develop snapshot build paths, with configurable DRY_RUN.
// Run the full build-and-deploy.yaml workflow locally via act + Docker. Supports pull_request and develop snapshot build paths, with configurable DRY_RUN.
| name | ci-act-run |
| description | Run the full build-and-deploy.yaml workflow locally via act + Docker. Supports pull_request and develop snapshot build paths, with configurable DRY_RUN. |
| compatibility | opencode |
.github/workflows/build-and-deploy.yaml workflow inside Docker using act.actions/setup-java@v5 (Temurin JDK 8), Xvfb headless display, cicd/gcviewer-script.sh (verify path), Codecov upload (best-effort).act pull_request sets CI_IS_PR=true → script runs perform_verify().act push with GITHUB_REF_NAME=develop, CI_IS_PR=false, CI_BRANCH=develop → script runs perform_snapshot_release().DRY_RUN is configurable via the GitHub repository variable DRY_RUN (default true). With DRY_RUN=true, no actual deploys or pushes are made — safe for local testing.!env.ACT..actrc: catthehacker/ubuntu:full-latest.DRY_RUN=true: Do NOT pass --secret GITHUB_TOKEN=.... Providing this secret causes the run to fail. Leave it completely unset — do not include the flag at all.DRY_RUN=false:
perform_snapshot_release): GITHUB_TOKEN and ENCRYPTION_PASSWORD are not required (no GitHub push, no GPG decrypt). Required secrets: CI_DEPLOY_USERNAME, CI_DEPLOY_PASSWORD (Sonatype OSSRH), SCP_USERNAME, SCP_PASSWORD (SourceForge SCP), CODECOV_TOKEN.perform_release): all secrets are required: GITHUB_TOKEN, ENCRYPTION_PASSWORD, CI_DEPLOY_USERNAME, CI_DEPLOY_PASSWORD, SCP_USERNAME, SCP_PASSWORD, CODECOV_TOKEN..env file at the project root. Pass them via --secret-file .env. The .env file must never be committed to git and never be read by the agent.ci-script-only-run skill instead if you only want to test cicd/gcviewer-script.sh paths (snapshot/release) without Docker.Run the following checks. If any fail, stop and report the issue.
docker infoact is installed:
act --versiongit rev-parse --show-toplevel.github/workflows/build-and-deploy.yamlcicd/gcviewer-script.sh.actrc (configures the Docker image — must contain -P ubuntu-latest=catthehacker/ubuntu:full-latest)If the Docker image catthehacker/ubuntu:full-latest has not been pulled before, inform the user:
Ask the user which CI event to simulate:
pull_request — simulates a PR build; script takes perform_verify() path.develop snapshot — simulates a push to the develop branch; script takes perform_snapshot_release() path.cancelIf user selects cancel, stop.
Record the chosen build path for use in steps 5 and 6.
Ask the user whether to run with DRY_RUN=true or DRY_RUN=false:
true (recommended) — skips actual deploys/pushes, safe for local testing. No real credentials needed.false — performs real deploys and pushes. Requires a real GITHUB_TOKEN and real deploy credentials.If the user selects DRY_RUN=false:
Display a clear warning:
WARNING: DRY_RUN=false will perform real Maven deploys, GitHub pushes, and tag operations. This cannot be undone. Ensure all secrets are real values.
Ask the user to explicitly confirm they want to continue (yes/no). If they do not confirm, stop.
Required variables and their meaning:
| Variable | Required for | Description |
|---|---|---|
GITHUB_TOKEN | Release only | Personal Access Token with repo scope — used by push_to_github() for pushes and tags. Not needed for snapshot builds. |
ENCRYPTION_PASSWORD | Release only | Maven/GPG encryption password for signing artifacts. Not needed for snapshot builds. |
CI_DEPLOY_USERNAME | Snapshot & Release | Username for Sonatype OSSRH Maven deploy server |
CI_DEPLOY_PASSWORD | Snapshot & Release | Password for Sonatype OSSRH Maven deploy server |
SCP_USERNAME | Snapshot & Release | SCP username for SourceForge file upload (used by sourceforge-release Maven profile) |
SCP_PASSWORD | Snapshot & Release | SCP password for SourceForge file upload |
CODECOV_TOKEN | Snapshot & Release | Codecov upload token |
Required .env file format (one KEY=value pair per line, no quotes needed):
CI_DEPLOY_USERNAME=your_sonatype_username
CI_DEPLOY_PASSWORD=your_sonatype_password
SCP_USERNAME=your_sourceforge_username
SCP_PASSWORD=your_sourceforge_password
CODECOV_TOKEN=your_codecov_token
Record the chosen DRY_RUN value for use in step 6.
The workflow matrix defaults to multiple java versions. Ask:
all (no --matrix flag added)Java 8Java 17Java 21Java 25cancelIf user selects cancel, stop.
If the user selects anything other than all, append --matrix java:<version> to the act command.
Run the appropriate command from the repo root based on the choices made in steps 3, 4, and 5.
REMINDER: Use
--var DRY_RUN=true/falseinstead of--env DRY_RUN=true/false. The workflow reads DRY_RUN from the GitHub repository variable (${{ vars.DRY_RUN }}) via the--varflag inact.--envis overridden by the workflow'senvblock and has no effect. WhenDRY_RUN=true, do NOT include--secret GITHUB_TOKEN=<anything>— it causes the run to fail. WhenDRY_RUN=false, secrets are read from.envvia--secret-file .env.
act pull_request \
-W .github/workflows/build-and-deploy.yaml \
--var DRY_RUN=true \
--secret ENCRYPTION_PASSWORD=dummy \
--secret CI_DEPLOY_USERNAME=dummy \
--secret CI_DEPLOY_PASSWORD=dummy \
--secret CODECOV_TOKEN=dummy
act pull_request \
-W .github/workflows/build-and-deploy.yaml \
--matrix java:17 \
--var DRY_RUN=true \
--secret ENCRYPTION_PASSWORD=dummy \
--secret CI_DEPLOY_USERNAME=dummy \
--secret CI_DEPLOY_PASSWORD=dummy \
--secret CODECOV_TOKEN=dummy
act pull_request \
-W .github/workflows/build-and-deploy.yaml \
--var DRY_RUN=false \
--secret GITHUB_TOKEN=<real_token> \
--secret ENCRYPTION_PASSWORD=<real_password> \
--secret CI_DEPLOY_USERNAME=<real_username> \
--secret CI_DEPLOY_PASSWORD=<real_password> \
--secret CODECOV_TOKEN=<real_token>
act push \
-W .github/workflows/build-and-deploy.yaml \
--var DRY_RUN=true \
--env GITHUB_REF_NAME=develop \
--secret ENCRYPTION_PASSWORD=dummy \
--secret CI_DEPLOY_USERNAME=dummy \
--secret CI_DEPLOY_PASSWORD=dummy \
--secret CODECOV_TOKEN=dummy
act push \
-W .github/workflows/build-and-deploy.yaml \
--matrix java:17 \
--var DRY_RUN=true \
--env GITHUB_REF_NAME=develop \
--secret ENCRYPTION_PASSWORD=dummy \
--secret CI_DEPLOY_USERNAME=dummy \
--secret CI_DEPLOY_PASSWORD=dummy \
--secret CODECOV_TOKEN=dummy
Uses --secret-file .env. For snapshot builds, only CI_DEPLOY_USERNAME, CI_DEPLOY_PASSWORD, SCP_USERNAME, SCP_PASSWORD, and CODECOV_TOKEN are required. GITHUB_TOKEN and ENCRYPTION_PASSWORD are optional (only used by the release path).
act push \
-W .github/workflows/build-and-deploy.yaml \
--matrix java:8 \
--var DRY_RUN=false \
--env GITHUB_REF_NAME=develop \
--secret-file .env
Report:
!env.ACT)CI_IS_PR=true → perform_verify() (regardless of branch or DRY_RUN)CI_IS_PR=false, CI_BRANCH=develop → perform_snapshot_release()
DRY_RUN=true: runs mvn clean verify javadoc:javadoc and logs what it would deploy.DRY_RUN=false
mvn clean deploy javadoc:javadoc -P sourceforge-release. for openjdk8 onlymvn clean verify javadoc:javadoc for all other openjdk versionsCI_IS_PR = true or CI_IS_PR = falseCI_BRANCH = develop (for develop snapshot)only verify (pull_request path) or build and deploy to sourceforge (SNAPSHOT only) (develop snapshot path)DRY_RUN = true or DRY_RUN = falseBUILD SUCCESS