Skip to content

fix(ci): correct hashFiles syntax in docs.yml workflow conditional#25

Merged
trsdn merged 2 commits into
mainfrom
copilot/fix-17
Sep 17, 2025
Merged

fix(ci): correct hashFiles syntax in docs.yml workflow conditional#25
trsdn merged 2 commits into
mainfrom
copilot/fix-17

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 17, 2025

The documentation workflow was failing with a syntax error due to incorrect usage of the hashFiles function in a conditional expression.

Problem

The docs.yml workflow was producing the following error:

Invalid workflow file: .github/workflows/docs.yml#L1
(Line: 66, Col: 9): Unrecognized function: 'hashFiles'. Located at position 1 within expression: hashFiles('docs/conf.py') != ''

This prevented documentation builds from running on all pull requests, breaking the CI pipeline for documentation-related changes.

Root Cause

The issue was on line 66 where hashFiles was incorrectly wrapped with ${{ }} in an if condition:

if: ${{ hashFiles('docs/conf.py') != '' }}

In GitHub Actions, if conditions already expect expressions and should not be wrapped with ${{ }}. The hashFiles function works correctly in other contexts (like cache keys) but requires different syntax in conditional expressions.

Solution

Removed the ${{ }} wrapper to use the correct GitHub Actions syntax:

if: hashFiles('docs/conf.py') != ''

This follows GitHub Actions best practices where conditional expressions are evaluated directly without the expression wrapper.

Validation

  • ✅ YAML syntax remains valid
  • ✅ The target file docs/conf.py exists (3885 bytes)
  • ✅ Logic is correct: returns true when the file exists, false otherwise
  • ✅ Minimal surgical change following repository guidelines

This fix ensures that Sphinx documentation builds will run properly when docs/conf.py is present, which it currently is.

Fixes #17.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: trsdn <24534196+trsdn@users.noreply.github.com>
Copilot AI changed the title [WIP] Invalid workflow file: docs.yml uses unrecognized hashFiles function fix(ci): correct hashFiles syntax in docs.yml workflow conditional Sep 17, 2025
Copilot AI requested a review from trsdn September 17, 2025 16:44
@trsdn trsdn marked this pull request as ready for review September 17, 2025 17:19
@trsdn trsdn merged commit 141aedb into main Sep 17, 2025
@trsdn trsdn deleted the copilot/fix-17 branch September 17, 2025 17:19
trsdn added a commit that referenced this pull request Sep 17, 2025
Add test comment to docs/README.md to trigger documentation workflow
and verify that the hashFiles('docs/conf.py') != '' condition works
without syntax errors after the fix in PR #25.

This tests Issue #29 resolution.
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.

Invalid workflow file: docs.yml uses unrecognized hashFiles function

2 participants