Skip to content

Commit 52b94de

Browse files
authored
Merge pull request #107 from backstage/chore/add-name-length-ci-check
chore: add CI check for 50-char codemod registry name limit
2 parents 9436fc5 + 78818ce commit 52b94de

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ jobs:
6767
if: steps.changed.outputs.lint_files != ''
6868
run: yarn lint ${{ steps.changed.outputs.lint_files }}
6969

70+
- name: Package name length check
71+
if: steps.codemods.outputs.dirs != ''
72+
run: |
73+
failed=0
74+
for dir in ${{ steps.codemods.outputs.dirs }}; do
75+
name=$(node -p "require('./$dir/package.json').name")
76+
len=${#name}
77+
if [ "$len" -gt 50 ]; then
78+
echo "::error::Package name '$name' is $len chars (max 50 for Codemod registry)"
79+
failed=1
80+
fi
81+
done
82+
[ "$failed" -eq 0 ] || exit 1
83+
7084
- name: Test (changed codemods)
7185
if: steps.codemods.outputs.dirs != ''
7286
run: |

0 commit comments

Comments
 (0)