Skip to content

CI: Add changed-files GitHub Action#111046

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
Repiteo:ci/changed-files-action
Feb 28, 2026
Merged

CI: Add changed-files GitHub Action#111046
Repiteo merged 1 commit into
godotengine:masterfrom
Repiteo:ci/changed-files-action

Conversation

@Repiteo

@Repiteo Repiteo commented Sep 29, 2025

Copy link
Copy Markdown
Contributor

Replaces our existing shell solution for determining changed files with a dedicated action: changed-files. While this process takes slightly longer than the shell script, it appears to have a much higher consistency with actually gathering the files. Most notably: this enables static checks on forks!

@Repiteo Repiteo added this to the 4.x milestone Sep 29, 2025
@Repiteo Repiteo requested a review from a team as a code owner September 29, 2025 20:30
@AThousandShips

AThousandShips commented Sep 30, 2025

Copy link
Copy Markdown
Member

Let's just add a dummy change temporarily to ensure this works correctly

@Repiteo Repiteo requested a review from a team as a code owner September 30, 2025 15:40
@Repiteo Repiteo removed the request for review from a team September 30, 2025 15:40
@Repiteo

Repiteo commented Sep 30, 2025

Copy link
Copy Markdown
Contributor Author

Dummy changes with a new file, renamed file, and modified file. The modified file was one of the few files in the entire repo with whitespace/"unsafe" characters in the name, so it doubles as a test to ensure those are processed correctly

@Repiteo

Repiteo commented Sep 30, 2025

Copy link
Copy Markdown
Contributor Author

The results in a pull request context are entirely as expected:

CHANGED_FILES: "dummy.txt" ".github/workflows/static_checks.yml" "modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AbstractGenericNode(Of T)_ScriptProperties.generated.cs" "dummy-rename.clangd"

The local push changes are technically working as expected, but reflect a potential inherent limitation where only the most recent commit is compared against (.github/workflows/static_checks.yml excluded):

CHANGED_FILES: "dummy.txt" "modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AbstractGenericNode(Of T)_ScriptProperties.generated.cs" "dummy-rename.clangd"

Having said that, there's an obscene number of inputs this action can accept, so it might be feasible to let it compare against the main branch of the repo instead. I'll do some testing today to verify

@AThousandShips

Copy link
Copy Markdown
Member

Should compare against the base branch or things will break badly when 4.6 branches off etc.

@Repiteo Repiteo force-pushed the ci/changed-files-action branch 4 times, most recently from c3c5f25 to 204b7ac Compare September 30, 2025 18:42
@Repiteo Repiteo force-pushed the ci/changed-files-action branch 2 times, most recently from 14e8f3a to 419cc73 Compare February 15, 2026 18:22
@Repiteo Repiteo requested a review from a team as a code owner February 15, 2026 18:22
@Repiteo Repiteo force-pushed the ci/changed-files-action branch 11 times, most recently from ec4aca8 to 4032624 Compare February 16, 2026 01:36
@Repiteo Repiteo requested a review from a team as a code owner February 16, 2026 01:36
@Repiteo Repiteo force-pushed the ci/changed-files-action branch 3 times, most recently from a97a6b7 to f33fcd2 Compare February 16, 2026 01:45
@Repiteo

Repiteo commented Feb 16, 2026

Copy link
Copy Markdown
Contributor Author

Finally got back to this & to a point that I'm totally satisfied with the output. I've accepted pushes falling back to the previous commit as a limitation of git itself, and will drop the idea of attempting upstream hacks (for now…)

While there's absolutely potential for more specialized output, I think this is a reasonable starting point. Future PRs can build off this action now that it exists, meaning conditionally enabling/disabling tests based on what's been changed (docs-only not running builds, android-only building just android, etc)

@Repiteo Repiteo removed request for a team February 16, 2026 01:53
@Repiteo Repiteo force-pushed the ci/changed-files-action branch 3 times, most recently from bb0bfe2 to 412d4a9 Compare February 23, 2026 16:30
@Repiteo Repiteo force-pushed the ci/changed-files-action branch 2 times, most recently from e86e928 to 217c5e4 Compare February 23, 2026 16:40
@Repiteo Repiteo force-pushed the ci/changed-files-action branch from 217c5e4 to 4e5ded7 Compare February 23, 2026 16:43
@Repiteo

Repiteo commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

Updated to have static_checks output the changed-files variable, meaning the clang-tidy check in linux_builds can safely and expediently reuse the exact same list of changed files @Ivorforce

@Repiteo Repiteo requested a review from Ivorforce February 23, 2026 16:55

@Ivorforce Ivorforce left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an action for this sounds good with me if we've had issues with reliability of the shell script before.

I don't know what a "treeless clone" is but the runtime/speed of the action seems fine.
I'm impartial on style, so maybe needs a more opinionated review.

Comment on lines +4 to +8
inputs:
changed-files:
description: A list of changed files.
required: true
type: string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will make it impossible to call this workflow without providing it changed files to check. Maybe we should make it not required and act accordingly (skip the clang-tidy check)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be possible to call via workflow_dispatch, with the input variable falling back to an empty string. But as an added precaution, I'll see if I can skip that step on dispatch entirely

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: I verified on my local repository that this is indeed how it works. Given the workflow_dispatch exception might be tricker than expected, I'll just leave this as-is

@Repiteo Repiteo modified the milestones: 4.x, 4.7 Feb 28, 2026
@Repiteo Repiteo merged commit 90a3d1a into godotengine:master Feb 28, 2026
20 checks passed
@Repiteo Repiteo deleted the ci/changed-files-action branch February 28, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants