Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 28, 2025

The make validate-workflows target failed with "actionlint: not found" because it invoked actionlint directly without proper setup.

Changes

Makefile (lines 333-337)

  • Changed to use Docker-based actionlint via ./gh-aw compile --actionlint
  • Added build dependency to ensure gh-aw binary exists
  • Consistent with existing make actionlint target

Makefile help text (line 591)

  • Updated to document build dependency
  • Removed nonexistent validate target from help

Before

validate-workflows:
	@echo "Validating compiled workflow lock files..."
	actionlint .github/workflows/*.lock.yml; \

After

validate-workflows: build
	@echo "Validating compiled workflow lock files..."
	./$(BINARY_NAME) compile --actionlint

Benefits

  1. No separate installation: Uses Docker-based actionlint (no need for make tools)
  2. Consistency: Same Docker integration as make actionlint target
  3. Cross-platform: Docker-based approach works everywhere
  4. Simplicity: Clean 3-line implementation vs complex PATH setup
  5. Up-to-date validation: Recompiles workflows before linting

This approach aligns with the project's architecture of using Docker for all external tools (actionlint, zizmor, poutine).

Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Debug and fix actionlint compilation failures</issue_title>
<issue_description>## Objective

Investigate and resolve actionlint compilation failures to enable workflow linting during the static analysis process.

Context

The static analysis report indicates that actionlint compilation is failing. actionlint is a static checker for GitHub Actions workflow files that catches common mistakes and best practices violations.

Approach

Step 1: Reproduce the compilation failure

# Try to compile with actionlint
make build
# Check for actionlint-related errors

Step 2: Identify the root cause

Check for:

  • Missing dependencies in go.mod
  • Version conflicts
  • Build tag issues
  • Installation method problems

Step 3: Determine fix approach

Depending on the issue:

  • Missing dependency: Add to go.mod and run go mod tidy
  • Version conflict: Update to compatible versions
  • Build configuration: Update Makefile or build scripts
  • Installation issue: Use alternative installation method (e.g., download binary)

Step 4: Implement the fix

Example fixes:

# If it's a Go dependency issue:
go get github.com/rhysd/actionlint/cmd/actionlint@latest
go mod tidy

# Or if using binary installation:
# Update Makefile to download actionlint binary

Step 5: Test actionlint integration

# Verify actionlint works
actionlint --version

# Test on sample workflow
actionlint .github/workflows/*.yml

Step 6: Integrate into build process

# Ensure it's part of the build
make build
make lint

Files to Modify

  • go.mod (if dependency issue)
  • go.sum (if dependency issue)
  • Makefile (if build process issue)
  • pkg/cli/compile_command.go (if integration issue)

Acceptance Criteria

  • Root cause of compilation failure identified
  • Fix implemented and tested
  • actionlint runs successfully on workflow files
  • actionlint integrated into make build or make lint
  • No actionlint-related errors in CI
  • Documentation updated if installation method changed

Estimated Effort

2-4 hours
Related to #7992

AI generated by Plan Command for discussion #7983

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 29, 2025 00:05
The validate-workflows Makefile target was failing because it tried to run
actionlint directly without ensuring it was installed in PATH. This caused
the error: "actionlint: not found".

Changes:
- Add check to ensure actionlint is installed before running
- Properly set PATH to include $(go env GOPATH)/bin for actionlint
- Provide helpful error message directing users to run 'make tools'
- Use || true to allow validation to complete even with linting issues

The target now:
1. Checks if actionlint is installed (in PATH or GOPATH/bin)
2. Shows clear error if not: "actionlint not found. Run 'make tools'"
3. Runs actionlint on all .lock.yml files with proper PATH
4. Reports linting issues without failing the build

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Document that validate-workflows requires 'make tools' to install actionlint
- Remove outdated 'validate' target from help (target doesn't exist)
- Clarify actionlint target dependencies

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
All actionlint integration points verified and working:
- validate-workflows target: Fixed PATH and installation check
- actionlint target: Uses Docker via gh-aw compile (working)
- make tools: Successfully installs actionlint binary
- gh-aw compile --actionlint: Docker-based linting (working)

The root cause was the validate-workflows Makefile target trying to run
actionlint without checking if it was installed or setting up PATH correctly.

Testing completed:
✅ Unit tests passing
✅ Build succeeds
✅ validate-workflows with and without actionlint
✅ actionlint Docker integration
✅ Help text updated

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Debug and fix actionlint compilation failures Fix validate-workflows target: actionlint not in PATH Dec 29, 2025
Copilot AI requested a review from mnkiefer December 29, 2025 00:11
Copy link
Contributor

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot always use docker based actionlint or compile --actionlint

Changed validate-workflows to use the Docker-based actionlint approach
via `./gh-aw compile --actionlint` instead of requiring native binary
installation. This ensures consistency with the `make actionlint` target
and eliminates the need for separate actionlint installation.

Benefits:
- No need to run 'make tools' to install actionlint binary
- Consistent Docker-based approach across all targets
- Cross-platform compatibility
- Same behavior as 'make actionlint'

The target now:
1. Depends on 'build' to ensure gh-aw binary exists
2. Compiles all workflows with actionlint validation
3. Uses Docker to run actionlint (no separate installation needed)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 29, 2025

@copilot always use docker based actionlint or compile --actionlint

Changed to use Docker-based actionlint via ./gh-aw compile --actionlint in commit 5385911. The validate-workflows target now uses the same Docker integration as the actionlint target, eliminating the need for separate binary installation.

Copilot AI changed the title Fix validate-workflows target: actionlint not in PATH Fix validate-workflows target: use Docker-based actionlint Dec 29, 2025
Copilot AI requested a review from pelikhan December 29, 2025 00:44
@pelikhan pelikhan marked this pull request as ready for review December 29, 2025 00:45
@pelikhan pelikhan merged commit 8e9e8c6 into main Dec 29, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/debug-actionlint-issues branch December 29, 2025 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan] Debug and fix actionlint compilation failures

3 participants