Skip to content

Instantly share code, notes, and snippets.

@dattasaurabh82
Last active February 19, 2025 00:04
Show Gist options
  • Save dattasaurabh82/88e343a9e7ae762adf57b15adf634696 to your computer and use it in GitHub Desktop.
Save dattasaurabh82/88e343a9e7ae762adf57b15adf634696 to your computer and use it in GitHub Desktop.

Prerequisites

  • Install Docker Desktop for Mac

  • Make sure socket is accessible

    Screenshot 2025-02-19 at 01 00 14

  • Install act using Homebrew:

    brew install act

Creating GitHub Actions workflow

mkdir -p .github/workflows
touch .github/workflows/build.yml

Edit the yml file according to your workflow needs ...

Running Tests

From your project root directory, run:

act -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest --container-architecture linux/amd64 -v

Note: The -v flag enables verbose output for better debugging.

Testing Specific Events

Test push event:

act push

Test manual workflow trigger:

act workflow_dispatch

Troubleshooting

  • If you see warnings about Apple M-series chip, ensure you're using the --container-architecture linux/amd64 flag
  • If Docker isn't running, you'll need to start Docker Desktop first
  • Use -v flag for verbose output when debugging issues

For more information about act, visit the nektos/act repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment