Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ jobs:
with:
node-version: "24"
cache: npm
cache-dependency-path: pkg/workflow/js/package-lock.json
cache-dependency-path: actions/setup/js/package-lock.json
- name: Report Node cache status
run: |
if [ "${{ steps.setup-node.outputs.cache-hit }}" == "true" ]; then
Expand All @@ -307,7 +307,7 @@ jobs:
fi
- name: npm ci
run: npm ci
working-directory: ./pkg/workflow/js
working-directory: ./actions/setup/js
- name: Build code
run: make build

Expand All @@ -332,7 +332,7 @@ jobs:
with:
node-version: "24"
cache: npm
cache-dependency-path: pkg/workflow/js/package-lock.json
cache-dependency-path: actions/setup/js/package-lock.json
- name: Report Node cache status
run: |
if [ "${{ steps.setup-node.outputs.cache-hit }}" == "true" ]; then
Expand All @@ -341,9 +341,9 @@ jobs:
echo "⚠️ Node cache miss" >> $GITHUB_STEP_SUMMARY
fi
- name: Install npm dependencies
run: cd pkg/workflow/js && npm ci
run: cd actions/setup/js && npm ci
- name: Run tests
run: cd pkg/workflow/js && npm test
run: cd actions/setup/js && npm test
bench:
needs: [lint-go, lint-js]
# Only run benchmarks on main branch for performance tracking
Expand Down Expand Up @@ -471,7 +471,7 @@ jobs:
with:
node-version: "24"
cache: npm
cache-dependency-path: pkg/workflow/js/package-lock.json
cache-dependency-path: actions/setup/js/package-lock.json

- name: Report Node cache status
run: |
Expand All @@ -482,7 +482,7 @@ jobs:
fi

- name: Install npm dependencies
run: cd pkg/workflow/js && npm ci
run: cd actions/setup/js && npm ci

# JavaScript and JSON formatting checks
- name: Lint JavaScript files
Expand Down
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,13 @@ make build # Automatically runs sync-js-scripts
2. Run `make build` (automatically syncs to pkg/workflow/js/)
3. The synced files in `pkg/workflow/js/` are embedded in the binary via `//go:embed`
4. **Never** edit production files in `pkg/workflow/js/` directly - they are generated
5. Test files (*.test.cjs) remain only in `pkg/workflow/js/` and are not synced
5. Test files (*.test.cjs) are in `actions/setup/js/` alongside source code

**Key points:**
- `actions/setup/js/*.cjs` = Source of truth (manually edited, production files only)
- `pkg/workflow/js/*.cjs` = Generated (copied during build, marked as linguist-generated)
- `pkg/workflow/js/*.test.cjs` = Test files (remain in pkg/workflow/js/, not synced)
- `actions/setup/js/*.test.cjs` = Test files (co-located with source code)
- Test files (*.test.cjs) are not synced between directories
- The build process: `actions/setup/js/` → `pkg/workflow/js/` → embedded in binary

**Summary of patterns:**
Expand Down
40 changes: 20 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ security-trivy:
# Test JavaScript files
.PHONY: test-js
test-js: build-js
cd pkg/workflow/js && npm run test:js -- --no-file-parallelism
cd actions/setup/js && npm run test:js -- --no-file-parallelism

.PHONY: build-js
build-js:
cd pkg/workflow/js && npm run typecheck
cd actions/setup/js && npm run typecheck

# Bundle JavaScript files with local requires
.PHONY: bundle-js
Expand Down Expand Up @@ -283,7 +283,7 @@ license-report: ## Generate CSV license report
deps: check-node-version
go mod download
go mod tidy
cd pkg/workflow/js && npm ci
cd actions/setup/js && npm ci

# Install development tools (including linter)
.PHONY: deps-dev
Expand All @@ -298,7 +298,7 @@ download-github-actions-schema:
@curl -s -o pkg/workflow/schemas/github-workflow.json \
"https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json"
@echo "Formatting schema with prettier..."
@cd pkg/workflow/js && npm run format:schema >/dev/null 2>&1
@cd actions/setup/js && npm run format:schema >/dev/null 2>&1
@echo "✓ Downloaded and formatted GitHub Actions schema to pkg/workflow/schemas/github-workflow.json"

# Run linter (full repository scan)
Expand Down Expand Up @@ -348,15 +348,15 @@ fmt: fmt-go fmt-cjs fmt-json
fmt-go:
go fmt ./...

# Format JavaScript (.cjs and .js) and JSON files in pkg/workflow/js directory
# Format JavaScript (.cjs and .js) and JSON files in actions/setup/js directory
.PHONY: fmt-cjs
fmt-cjs:
cd pkg/workflow/js && npm run format:cjs
cd actions/setup/js && npm run format:cjs

# Format JSON files in pkg directory (excluding pkg/workflow/js, which is handled by npm script)
# Format JSON files in pkg directory (excluding actions/setup/js, which is handled by npm script)
.PHONY: fmt-json
fmt-json:
cd pkg/workflow/js && npm run format:pkg-json
cd actions/setup/js && npm run format:pkg-json

# Check formatting
.PHONY: fmt-check
Expand All @@ -366,25 +366,25 @@ fmt-check:
exit 1; \
fi

# Check JavaScript (.cjs and .js) and JSON file formatting in pkg/workflow/js directory
# Check JavaScript (.cjs and .js) and JSON file formatting in actions/setup/js directory
.PHONY: fmt-check-cjs
fmt-check-cjs:
cd pkg/workflow/js && npm run lint:cjs
cd actions/setup/js && npm run lint:cjs

# Check JSON file formatting in pkg directory (excluding pkg/workflow/js, which is handled by npm script)
# Check JSON file formatting in pkg directory (excluding actions/setup/js, which is handled by npm script)
.PHONY: fmt-check-json
fmt-check-json:
@if ! cd pkg/workflow/js && npm run check:pkg-json 2>&1 | grep -q "All matched files use Prettier code style"; then \
@if ! cd actions/setup/js && npm run check:pkg-json 2>&1 | grep -q "All matched files use Prettier code style"; then \
echo "JSON files are not formatted. Run 'make fmt-json' to fix."; \
exit 1; \
fi

# Lint JavaScript (.cjs and .js) and JSON files in pkg/workflow/js directory
# Lint JavaScript (.cjs and .js) and JSON files in actions/setup/js directory
.PHONY: lint-cjs
lint-cjs: fmt-check-cjs
@echo "✓ JavaScript formatting validated"

# Lint JSON files in pkg directory (excluding pkg/workflow/js, which is handled by npm script)
# Lint JSON files in pkg directory (excluding actions/setup/js, which is handled by npm script)
.PHONY: lint-json
lint-json: fmt-check-json
@echo "✓ JSON formatting validated"
Expand Down Expand Up @@ -558,13 +558,13 @@ help:
@echo " golint-incremental - Run golangci-lint incrementally (only changed files, requires BASE_REF)"
@echo " lint - Run linter"
@echo " fmt - Format code"
@echo " fmt-cjs - Format JavaScript (.cjs and .js) and JSON files in pkg/workflow/js"
@echo " fmt-json - Format JSON files in pkg directory (excluding pkg/workflow/js)"
@echo " fmt-cjs - Format JavaScript (.cjs and .js) and JSON files in actions/setup/js"
@echo " fmt-json - Format JSON files in pkg directory (excluding actions/setup/js)"
@echo " fmt-check - Check code formatting"
@echo " fmt-check-cjs - Check JavaScript (.cjs) and JSON file formatting in pkg/workflow/js"
@echo " fmt-check-json - Check JSON file formatting in pkg directory (excluding pkg/workflow/js)"
@echo " lint-cjs - Lint JavaScript (.cjs) and JSON files in pkg/workflow/js"
@echo " lint-json - Lint JSON files in pkg directory (excluding pkg/workflow/js)"
@echo " fmt-check-cjs - Check JavaScript (.cjs) and JSON file formatting in actions/setup/js"
@echo " fmt-check-json - Check JSON file formatting in pkg directory (excluding actions/setup/js)"
@echo " lint-cjs - Lint JavaScript (.cjs) and JSON files in actions/setup/js"
@echo " lint-json - Lint JSON files in pkg directory (excluding actions/setup/js)"
@echo " lint-errors - Lint error messages for quality compliance"
@echo " security-scan - Run all security scans (gosec, govulncheck, trivy)"
@echo " security-gosec - Run gosec Go security scanner"
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions actions/setup/js/log_parser_bootstrap.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function runLogParser(options) {
model,
parserName,
});

// Add safe outputs preview to step summary
let fullMarkdown = copilotCliStyleMarkdown;
if (safeOutputsContent) {
Expand All @@ -133,20 +133,20 @@ function runLogParser(options) {
fullMarkdown += "\n" + safeOutputsMarkdown;
}
}

core.summary.addRaw(fullMarkdown).write();
} else {
// Fallback: just log success message for parsers without log entries
core.info(`${parserName} log parsed successfully`);

// Add safe outputs preview to core.info (fallback path)
if (safeOutputsContent) {
const safeOutputsPlainText = formatSafeOutputsPreview(safeOutputsContent, { isPlainText: true });
if (safeOutputsPlainText) {
core.info(safeOutputsPlainText);
}
}

// Write original markdown to step summary if available
let fullMarkdown = markdown;
if (safeOutputsContent) {
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions actions/setup/js/log_parser_shared.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ function formatSafeOutputsPreview(safeOutputsContent, options = {}) {
preview.push("");
preview.push("Safe Outputs Preview:");
preview.push(` Total: ${entries.length} ${entries.length === 1 ? "entry" : "entries"}`);

for (let i = 0; i < entriesToShow.length; i++) {
const entry = entriesToShow[i];
preview.push("");
Expand Down Expand Up @@ -1448,12 +1448,12 @@ function formatSafeOutputsPreview(safeOutputsContent, options = {}) {
const entry = entriesToShow[i];
preview.push(`### ${i + 1}. ${entry.type || "Unknown Type"}`);
preview.push("");

if (entry.title) {
preview.push(`**Title:** ${entry.title}`);
preview.push("");
}

if (entry.body) {
const bodyPreview = truncateString(entry.body, 200);
preview.push("<details>");
Expand Down
File renamed without changes.
File renamed without changes.
Loading
Loading