Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#3,857 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
90/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
git, github-actions, shell
領域
ci-cd

調査の方向性

失敗しているロジックは .github/workflows/test.yml の73~77行目付近にあります。まず Main test job と参照されている failure run を読み、次に push イベントと pull_request イベントが比較対象のコミットをどのように公開するかを確認してください。ファイル検出ステップを更新し、両方のイベントタイプで意図した data/ パスが生成されるようにして、pull request で空の FILES 変数が原因となって Main test workflow が終了しなくなったことを確認してください。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Shell
スター
421
フォーク
822
平均マージ
14時間 28分
マージ済み PR(30日)
467

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AppImage/appimage.github.io のほかの issue

AppImage/appimage.github.io の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。