Skip to content

Commit 2f933de

Browse files
committed
feat(action): add target_dir input to control scan root
Update workflow example and use target_dir in pacta scan commands instead of hardcoded `.`
1 parent e64ee19 commit 2f933de

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/test-action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ jobs:
2222
- name: Run action (default inputs)
2323
uses: ./
2424
with:
25-
model: architecture.yml
26-
rules: rules.pacta.yml
25+
target_dir: 'examples/hexagonal-app/'
26+
model: examples/hexagonal-app/architecture.yml
27+
rules: examples/hexagonal-app/rules.pacta.yml
2728
fail-on-violations: "false"
2829
pacta-version: "local"

action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ branding:
55
color: 'blue'
66

77
inputs:
8+
target_dir:
9+
description: 'Repository root (default: .)'
10+
required: false
11+
default: '.'
812
model:
913
description: 'Path to architecture.yml'
1014
required: false
@@ -56,10 +60,10 @@ runs:
5660
fi
5761
5862
# Generate GitHub Markdown comment
59-
pacta scan . $ARGS --format github > "$RUNNER_TEMP/pacta-comment.md" || true
63+
pacta scan ${{ inputs.target_dir }} $ARGS --format github > "$RUNNER_TEMP/pacta-comment.md" || true
6064
6165
# Generate JSON for machine-readable results
62-
pacta scan . $ARGS --format json > "$RUNNER_TEMP/pacta-results.json" || true
66+
pacta scan ${{ inputs.target_dir }} $ARGS --format json > "$RUNNER_TEMP/pacta-results.json" || true
6367
6468
# Extract new violation count
6569
NEW=$(jq '.summary.by_status.new // 0' "$RUNNER_TEMP/pacta-results.json" 2>/dev/null || echo 0)

0 commit comments

Comments
 (0)