Skip to content

Instantly share code, notes, and snippets.

@mahendrapaipuri
Last active January 15, 2025 20:00
Show Gist options
  • Save mahendrapaipuri/42961a0bd17905e23e39f5f0ac863f46 to your computer and use it in GitHub Desktop.
Save mahendrapaipuri/42961a0bd17905e23e39f5f0ac863f46 to your computer and use it in GitHub Desktop.
Using act for testing GitHub workflows locally with artifacts
# Install artifacts server
git clone https://github.com/anthonykawa/artifact-server.git
npm install
# Start artifacts server with AUTH_KEY env var set
# By default this will start server on port 8080
AUTH_KEY=foo npm run start
# Install act and run workflows
# Assuming we are in the root of the repo and workflow is defined in main.yaml file
act -W .github/workflows/main.yaml --env ACTIONS_RUNTIME_URL=http://localhost:8080/ --env ACTIONS_RUNTIME_TOKEN=foo
# Seems like we do not need to start artifact server seperately. We can directly pass artificat-server-path flag in CLI
act -W .github/workflows/main.yaml --artifact-server-path=/tmp/artifacts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment