fix: 'failed to read action' errors when using relative workdir_parent #1175

Merged
mfenniak merged 2 commits from mfenniak/forgejo-runner:fix-failed-to-read-action into main 2025-11-22 13:17:17 +00:00
Owner

When workdir_parent is a relative path, actions were failing with error:

⚙️ [runner]: failed to read action 'Checkout', no files found after reading paths: action.yml, action.yaml, Dockerfile

The cause of this is that worktree creation using git -C relative/repodir worktree add relative/worktree would actually create the relative/worktree inside the repo. It seems that git -C to operate on a repo changes the working directory into that repo and evaluates relative paths from there.

Fixed by converting workdir_parent into an absolute path after the config file is read, and adding an error in the git operations if a relative path somehow makes its way through.

  • bug fixes
    • PR: fix: 'failed to read action' errors when using relative workdir_parent
When `workdir_parent` is a relative path, actions were failing with error: ``` ⚙️ [runner]: failed to read action 'Checkout', no files found after reading paths: action.yml, action.yaml, Dockerfile ``` The cause of this is that worktree creation using `git -C relative/repodir worktree add relative/worktree` would actually create the `relative/worktree` inside the repo. It seems that `git -C` to operate on a repo changes the working directory into that repo and evaluates relative paths from there. Fixed by converting `workdir_parent` into an absolute path after the config file is read, and adding an error in the git operations if a relative path somehow makes its way through. <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/1175): <!--number 1175 --><!--line 0 --><!--description Zml4OiAnZmFpbGVkIHRvIHJlYWQgYWN0aW9uJyBlcnJvcnMgd2hlbiB1c2luZyByZWxhdGl2ZSB3b3JrZGlyX3BhcmVudA==-->fix: 'failed to read action' errors when using relative workdir_parent<!--description--> <!--end release-notes-assistant-->
mfenniak force-pushed fix-failed-to-read-action from 0764ee1408
Some checks failed
issue-labels / release-notes (pull_request_target) Successful in 7s
checks / validate pre-commit-hooks file (pull_request) Successful in 30s
checks / build and test (pull_request) Failing after 37s
checks / validate mocks (pull_request) Successful in 33s
checks / runner exec tests (pull_request) Has been skipped
checks / runner integration tests (pull_request) Has been skipped
checks / integration tests (pull_request) Successful in 11m9s
to 9744c5532a
All checks were successful
cascade / forgejo (pull_request_target) Has been skipped
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 5s
checks / validate mocks (pull_request) Successful in 33s
checks / validate pre-commit-hooks file (pull_request) Successful in 33s
checks / build and test (pull_request) Successful in 1m51s
checks / runner exec tests (pull_request) Successful in 24s
checks / runner integration tests (pull_request) Successful in 4m56s
checks / integration tests (pull_request) Successful in 10m27s
2025-11-22 02:22:05 +00:00
Compare
mfenniak force-pushed fix-failed-to-read-action from 9744c5532a
All checks were successful
cascade / forgejo (pull_request_target) Has been skipped
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 5s
checks / validate mocks (pull_request) Successful in 33s
checks / validate pre-commit-hooks file (pull_request) Successful in 33s
checks / build and test (pull_request) Successful in 1m51s
checks / runner exec tests (pull_request) Successful in 24s
checks / runner integration tests (pull_request) Successful in 4m56s
checks / integration tests (pull_request) Successful in 10m27s
to 6d791d30ff
All checks were successful
checks / validate mocks (pull_request) Successful in 36s
checks / validate pre-commit-hooks file (pull_request) Successful in 35s
checks / build and test (pull_request) Successful in 43s
checks / runner exec tests (pull_request) Successful in 27s
issue-labels / release-notes (pull_request_target) Successful in 4s
checks / runner integration tests (pull_request) Successful in 5m12s
checks / integration tests (pull_request) Successful in 10m18s
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Successful in 6s
cascade / forgejo (pull_request_target) Successful in 1m29s
2025-11-22 02:28:00 +00:00
Compare
Contributor

cascading-pr updated at actions/setup-forgejo#773

cascading-pr updated at https://code.forgejo.org/actions/setup-forgejo/pulls/773
Author
Owner

Regression caused by #1162.

Regression caused by #1162.
mfenniak deleted branch fix-failed-to-read-action 2025-11-22 13:17:17 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/runner!1175
No description provided.