`check-dist` can miss newly generated untracked files
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- bash, github-actions
- Domain
- ci-cd
Research direction
The check lives in .github/workflows/check-dist.yml around line 48, where it runs git diff --ignore-space-at-eol over the dist path. Read how the step fails, then confirm that git ls-files --others --exclude-standard misses nothing the diff check does not already catch. Done means a newly generated untracked file under the dist path fails the job, while a whitespace-only change to a tracked file still passes. Verify both cases by running the step locally in a scratch repo.
Written by the indexing model from the issue text.
Description
The check in check-dist.yml counts lines from git diff --ignore-space-at-eol. Since git diff does not report untracked files, a build can create a new file under ${{ inputs.dist-path }} and the check may still pass.
Using git status --porcelain alone would detect untracked files, but it would also fail on tracked changes consisting only of trailing whitespace, which the current check intentionally ignores.
One option is to check for untracked files separately while keeping the existing whitespace handling for tracked changes:
if [ -n "$(git ls-files --others --exclude-standard -- "${{ inputs.dist-path }}")" ] ||
! git diff --ignore-space-at-eol --quiet -- "${{ inputs.dist-path }}"; then
This catches new, non-ignored untracked files as well as tracked modifications and deletions, while continuing to ignore end-of-line whitespace changes.
- Dominant language
- JavaScript
- Stars
- 89
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from actions/reusable-workflows
-
Feature request: opt-in reusable workflow to rebuild and commit generated files on Dependabot PRsOpen
Difficulty 4/5 3-5 days Newbie friendliness 50/100
actions/reusable-workflows#70 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
actions/reusable-workflows#12 · 1 comment ·
All issues in actions/reusable-workflows
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Spomky-Labs/pwa-bundle#476 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
c1overzz/dsh-bili-scroll#35 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pbakaus/impeccable#1077 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day