Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Fix: Main test workflow fails with empty FILES variable in pull requests

Open Beginner friendly
#3,857 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
90/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
git, github-actions, shell
Domain
ci-cd

Research direction

The failing logic is in .github/workflows/test.yml around lines 73-77; start by reading the Main test job and the referenced failure run, then verify how push and pull_request events expose the commits being compared. Update the file-detection step so both event types produce the intended data/ paths, and confirm the Main test workflow no longer exits on an empty FILES variable for a pull request.

Written by the indexing model from the issue text.

Description

Problem

The "Main test" job in the test workflow is failing with:

Variable FILES is empty.

This occurs because the git log command used to detect changed files doesn't work correctly for pull requests.

Root Cause

The current file detection logic (line 74 in .github/workflows/test.yml):

FILES=$(git log -1 -p data/ | grep +++ | cut -d '/' -f 2-| sed -e 's|dev/null||g')

For pull requests, git log -1 examines the merge commit created by GitHub, which doesn't contain the actual file changes from the PR. This results in an empty FILES variable, causing the job to exit with code 1.

Solution

Replace the file detection logic to handle both push and pull request events correctly:

# Find out which files in data/ have been changed in the last commit
if [ "${{ github.event_name }}" == "pull_request" ]; then
  # For PRs, compare against the base branch
  FILES=$(git diff --name-only origin/master...HEAD -- data/ | sed -e 's|^|data/|')
else
  # For pushes, use the standard git log approach
  FILES=$(git log -1 -p data/ | grep +++ | cut -d '/' -f 2- | sed -e 's|dev/null||g')
fi

echo "Last changed files from the FILES variable:"
echo "$FILES"
if [ -z "$FILES" ]; then
  echo "Variable FILES is empty."
  exit 1
fi

This approach:

  • For PRs: Uses git diff --name-only origin/master...HEAD -- data/ to compare the PR branch against the base branch, correctly identifying changed files
  • For pushes: Maintains the existing logic
  • Ensures files are properly formatted with the data/ prefix

Apply this change to lines 73-77 of .github/workflows/test.yml

Failure Reference

https://github.com/AppImage/appimage.github.io/actions/runs/31879003988/job/94998828969

Dominant language
Shell
Stars
395
Forks
800
Avg merge
6h 21m
Merged PRs (30d)
301

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AppImage/appimage.github.io

All issues in AppImage/appimage.github.io

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.