fix: Use nektos/act instead of gitea/act_runner for local testing

gitea/act_runner is a runner daemon that needs to connect to a Gitea instance,
not a local testing tool. nektos/act is the correct tool for running workflows
locally, and it's compatible with both GitHub Actions and Gitea Actions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-10 14:10:42 +00:00
parent a8da8753f1
commit 9df7278d55
2 changed files with 22 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
#!/bin/bash
# Script to test Gitea Actions workflow locally using act_runner
# Script to test Gitea Actions workflow locally using act (nektos/act)
# This runs the actual .gitea/workflows/magnitude.yml file in a containerized environment
set -e # Exit on error
@@ -25,7 +25,7 @@ fi
echo -e "${YELLOW}Loading environment variables from .env${NC}"
export $(cat .env | grep -v '^#' | xargs)
# Build secret flags for act_runner
# Build secret flags for act
# These will be available in the workflow as secrets.*
SECRET_FLAGS=""
SECRET_FLAGS="$SECRET_FLAGS -s ATPROTO_CLIENT_ID=$ATPROTO_CLIENT_ID"
@@ -37,20 +37,21 @@ SECRET_FLAGS="$SECRET_FLAGS -s TEST_BLUESKY_HANDLE=$TEST_BLUESKY_HANDLE"
SECRET_FLAGS="$SECRET_FLAGS -s TEST_BLUESKY_PASSWORD=$TEST_BLUESKY_PASSWORD"
SECRET_FLAGS="$SECRET_FLAGS -s ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY"
echo -e "${YELLOW}Running Gitea Actions workflow with act_runner${NC}"
echo -e "${YELLOW}Running Gitea Actions workflow with act (nektos/act)${NC}"
echo -e "${YELLOW}This will execute .gitea/workflows/magnitude.yml${NC}"
# Run act_runner in Docker to execute the workflow
# - Mount Docker socket so act_runner can create containers
# Run act in Docker to execute the workflow
# - Mount Docker socket so act can create containers
# - Mount current directory as workspace
# - Pass secrets as flags
# - Use -W flag to specify workflow file
# - Use --rm to clean up container after run
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$(pwd):/workspace" \
-w /workspace \
-e ACTIONS_CACHE_URL="" \
gitea/act_runner:latest \
exec -W .gitea/workflows/magnitude.yml \
nektos/act:latest \
-W .gitea/workflows/magnitude.yml \
$SECRET_FLAGS || {
echo -e "${RED}Workflow execution failed!${NC}"
exit 1