Skip to content

[WIP] Fix invalid hashFiles usage in CI workflow - #4002

Closed
bgoncal with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-ci-workflow-hashfiles-usage
Closed

[WIP] Fix invalid hashFiles usage in CI workflow#4002
bgoncal with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-ci-workflow-hashfiles-usage

Conversation

Copilot AI commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

Fix hashFiles usage in CI workflow

Plan:

  • Explore repository structure and understand the issue
  • Examine current state of .github/workflows/ci.yml
  • Verify if hashFiles syntax is correct or needs fixing
  • Make minimal changes if needed to fix hashFiles syntax
  • Validate YAML syntax
  • Update PR description with reference to failing job
  • Complete task

Issue: The CI workflow may contain invalid hashFiles usage where multiple file patterns are passed as a single comma-separated string instead of separate arguments. This causes jobs to fail with "hashFiles(...) failed. Fail to hash files under directory".

Reference: https://github.com/home-assistant/iOS/actions/runs/19630900264/job/56210284725?pr=4001

Original prompt

Problem: The CI workflow .github/workflows/ci.yml contains an invalid hashFiles usage that causes the job to fail with: "hashFiles('**/Gemfile.lock, **/Podfile.lock, Tools/BuildMaterialDesignIconsFont.sh') failed. Fail to hash files under directory". This occurs because multiple file patterns were passed as a single comma-separated string instead of separate arguments to hashFiles.

Files to change:

  • .github/workflows/ci.yml

Required fix:

  • Replace the incorrect hashFiles call(s) that pass multiple comma-separated paths as one string with hashFiles called with multiple separate string arguments.

Specifically, update both occurrences in the file where the cache key is constructed:

  1. In the "test" job cache key (previously):
    ${{ hashFiles('/Gemfile.lock', '/Podfile.lock', 'Tools/BuildMaterialDesignIconsFont.sh') }}

  2. In the "size" job cache key (previously):
    ${{ hashFiles('/Gemfile.lock', '/Podfile.lock', 'Tools/BuildMaterialDesignIconsFont.sh') }}

(If there are any occurrences where the value is a single comma-separated string like hashFiles('**/Gemfile.lock, **/Podfile.lock, Tools/BuildMaterialDesignIconsFont.sh'), change them to use separate arguments.)

Change details (patch):

  • Open .github/workflows/ci.yml and locate the cache key expressions under the "Cache: Pods" steps in the "test" and "size" jobs.
  • Replace the invalid calls with the correct syntax using separate arguments to hashFiles.

Example updated snippet for both jobs:

  key: >-
    ${{ runner.os }}-pods-${{ env.DEVELOPER_DIR }}-
    ${{ hashFiles('**/Gemfile.lock', '**/Podfile.lock', 'Tools/BuildMaterialDesignIconsFont.sh') }}

Why this fixes it:

  • hashFiles expects multiple file patterns as separate arguments. Passing a single comma-separated string makes the function try to interpret the entire string as a single path pattern and fail to find/have permissions to hash files, causing the workflow template validation error.

Follow-up:

Please apply the changes and open the PR.

This pull request was created as a result of the following prompt from Copilot chat.

Problem: The CI workflow .github/workflows/ci.yml contains an invalid hashFiles usage that causes the job to fail with: "hashFiles('**/Gemfile.lock, **/Podfile.lock, Tools/BuildMaterialDesignIconsFont.sh') failed. Fail to hash files under directory". This occurs because multiple file patterns were passed as a single comma-separated string instead of separate arguments to hashFiles.

Files to change:

  • .github/workflows/ci.yml

Required fix:

  • Replace the incorrect hashFiles call(s) that pass multiple comma-separated paths as one string with hashFiles called with multiple separate string arguments.

Specifically, update both occurrences in the file where the cache key is constructed:

  1. In the "test" job cache key (previously):
    ${{ hashFiles('/Gemfile.lock', '/Podfile.lock', 'Tools/BuildMaterialDesignIconsFont.sh') }}

  2. In the "size" job cache key (previously):
    ${{ hashFiles('/Gemfile.lock', '/Podfile.lock', 'Tools/BuildMaterialDesignIconsFont.sh') }}

(If there are any occurrences where the value is a single comma-separated string like hashFiles('**/Gemfile.lock, **/Podfile.lock, Tools/BuildMaterialDesignIconsFont.sh'), change them to use separate arguments.)

Change details (patch):

  • Open .github/workflows/ci.yml and locate the cache key expressions under the "Cache: Pods" steps in the "test" and "size" jobs.
  • Replace the invalid calls with the correct syntax using separate arguments to hashFiles.

Example updated snippet for both jobs:

  key: >-
    ${{ runner.os }}-pods-${{ env.DEVELOPER_DIR }}-
    ${{ hashFiles('**/Gemfile.lock', '**/Podfile.lock', 'Tools/BuildMaterialDesignIconsFont.sh') }}

Why this fixes it:

  • hashFiles expects multiple file patterns as separate arguments. Passing a single comma-separated string makes the function try to interpret the entire string as a single path pattern and fail to find/have permissions to hash files, causing the workflow template validation error.

Follow-up:

Please apply the changes and open the PR.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@bgoncal bgoncal closed this Nov 24, 2025
@bgoncal
bgoncal deleted the copilot/fix-ci-workflow-hashfiles-usage branch November 24, 2025 10:33
Copilot AI requested a review from bgoncal November 24, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants