Skip to content

Commit 1131bdb

Browse files
mydeaclaude
andcommitted
chore(ci): Vendor nx-affected-list action, drop dkhunt27 dependency
Replace the third-party dkhunt27/action-nx-affected-list@v6.1 with a lightweight composite action that runs `nx show projects --affected` directly. The external action was outdated (last release Sep 2024, uses Node.js 20) and all it did was shell out to the nx CLI. The vendored action is ~15 lines of bash with no Node.js runtime dependency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a548013 commit 1131bdb

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'Nx Affected List'
2+
description: 'Outputs a space-separated list of Nx projects affected by changes between base and head commits.'
3+
4+
inputs:
5+
base:
6+
description: 'Base commit SHA'
7+
required: false
8+
head:
9+
description: 'Head commit SHA'
10+
required: false
11+
12+
outputs:
13+
affected:
14+
description: 'Space-separated list of affected project names'
15+
value: ${{ steps.affected.outputs.affected }}
16+
17+
runs:
18+
using: 'composite'
19+
steps:
20+
- name: Get affected Nx projects
21+
id: affected
22+
shell: bash
23+
run: |
24+
ARGS=""
25+
if [ -n "${{ inputs.base }}" ]; then ARGS="$ARGS --base=${{ inputs.base }}"; fi
26+
if [ -n "${{ inputs.head }}" ]; then ARGS="$ARGS --head=${{ inputs.head }}"; fi
27+
28+
AFFECTED=$(./node_modules/.bin/nx show projects --affected $ARGS 2>/dev/null | tr '\n' ' ' | xargs) || true
29+
echo "affected=$AFFECTED" >> "$GITHUB_OUTPUT"
30+
31+
if [ -n "$AFFECTED" ]; then
32+
echo "Affected projects: $AFFECTED"
33+
else
34+
echo "No affected projects found"
35+
fi

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
id: install_dependencies
104104

105105
- name: Check for Affected Nx Projects
106-
uses: dkhunt27/action-nx-affected-list@v6.1
106+
uses: ./.github/actions/nx-affected-list
107107
id: checkForAffected
108108
if: github.event_name == 'pull_request'
109109
with:

0 commit comments

Comments
 (0)