Skip to content

Create additional documentation for testing GitHub Actions using nektos/act #8712

Description

@egcuriel

Overview

We need to create additional documentation to supplement the existing 'How to Test GitHub Actions' series that is available in the Google Drive, to provide a testing track for developers who need to test or modify complex, event-driven GitHub Actions workflows locally before pushing changes or reviewing pull requests.

Action Items

The documentation should provide a step-by-step walkthrough for configuring act locally, specifically addressing the unique hurdles of our repository and should be broken down into universal testing steps and OS-specific setup:

Universal Emulation Steps (Mac, Windows, Linux):

  • Mocking GitHub Context: Explain why event-driven workflows crash locally without payload data, and provide the exact curl/jq commands to fetch live issue data and format it into an event.json payload.
  • Secure Authentication & Context Spoofing:
    • Setting up a .secrets file with a Personal Access Token (PAT) for GraphQL API queries.
    • Overriding the GITHUB_REPOSITORY environment variable during execution so act queries the main hackforla/website repository instead of a personal fork.
  • Git Remote Configuration: (Optional but recommended) Ensuring developers have their Git remotes configured for SSH to streamline the testing and pushing pipeline.

Linux/WSL Specific Setup:

  • Installation & Compilation Hurdles: How to bypass outdated apt packages to install modern Go (1.21+) and compile act from source (this serves as a crucial troubleshooting fallback for developers when standard package managers fail).

Resources/Instructions

Hack for LA Google Drive:
'\HackforLA.org website\HackforLA.org website folder\3 - Developers\GitHub Actions (GHA)\1. How to test GitHub Actions.gdoc'
1. How to Test GitHub Actions - using nektos/act

'\HackforLA.org website\HackforLA.org website folder\3 - Developers\GitHub Actions (GHA)\2. Additional Notes for GitHub Actions.docx'
2. Additional Notes for GitHub Actions

External Resources:
nektos/act Official Repository
GitHub API: Fetching an Issue
jq Manual (for JSON parsing)

Metadata

Metadata

Assignees

Type

No type

Projects

Status
New Issue Approval

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions