fix: runs-on is also mandatory for reusable workflows and may be needing container #194

Merged
earl-warren merged 1 commit from earl-warren/act:wip-workflow-call into main 2025-07-26 12:24:42 +00:00
Contributor

If not the schema validation will fail because it will be try to validate as if not calling a reusable workflow.

=== RUN   TestWorkflowCallRunsOn
    schema_test.go:119:
        	Error Trace:	/home/earl-warren/software/act/pkg/schema/schema_test.go:119
        	Error:      	Received unexpected error:
        	            	Line: 10 Column 5: Failed to match job-factory: Line: 12 Column 5: Unknown Property uses
        	            	Line: 13 Column 5: Unknown Property with
        	            	Line: 15 Column 5: Unknown Property secrets
        	            	Line: 10 Column 5: Failed to match workflow-job: Line: 11 Column 5: Unknown Property runs-on
        	Test:       	TestWorkflowCallRunsOn
If not the schema validation will fail because it will be try to validate as if not calling a reusable workflow. ``` === RUN TestWorkflowCallRunsOn schema_test.go:119: Error Trace: /home/earl-warren/software/act/pkg/schema/schema_test.go:119 Error: Received unexpected error: Line: 10 Column 5: Failed to match job-factory: Line: 12 Column 5: Unknown Property uses Line: 13 Column 5: Unknown Property with Line: 15 Column 5: Unknown Property secrets Line: 10 Column 5: Failed to match workflow-job: Line: 11 Column 5: Unknown Property runs-on Test: TestWorkflowCallRunsOn ```
earl-warren changed title from fix: runs-on is also mandatory for reusable workflows [skip cascade] to fix: runs-on is also mandatory for reusable workflows 2025-07-25 09:48:09 +00:00
earl-warren force-pushed wip-workflow-call from 364e2167ce
All checks were successful
/ cascade (pull_request_target) Has been skipped
checks / unit (pull_request) Successful in 2m30s
checks / integration (pull_request) Successful in 1m47s
to 50c850d757
All checks were successful
/ cascade (pull_request_target) Successful in 1m31s
checks / unit (pull_request) Successful in 1m32s
checks / integration (pull_request) Successful in 2m53s
2025-07-25 09:49:59 +00:00
Compare
Contributor

cascading-pr updated at forgejo/runner#732

cascading-pr updated at https://code.forgejo.org/forgejo/runner/pulls/732
Contributor

cascading-pr updated at forgejo/runner#732

cascading-pr updated at https://code.forgejo.org/forgejo/runner/pulls/732
@ -93,0 +104,4 @@
jobs:
build_frontend_dev:
name: Build Silo Frontend DEV
runs-on: ubuntu-latest

I'm confused. Why do we need a runs-on here? 🤔(I know we don't support reusable workflows yet)

I'm confused. Why do we need a `runs-on` here? 🤔(I know we don't support reusable workflows yet)
Author
Contributor

I think you're right. It is redundant with the runs-on that is mandatory in the workflow being reused. My bad.

I think you're right. It is redundant with the runs-on that is mandatory in the workflow being reused. My bad.
earl-warren marked this conversation as resolved
Author
Contributor

Actually... this is necessary because a workflow that uses a workflow call will need a runs-on to be picked up by the runner. Otherwise it will not. The workflow that is re-used also needs a runs-on although it may not be necessary in some cases:

  • Not necessary if it is called from another workflow with the workflow_call event
  • Necessary if it is called because it is triggered by a push event

The two cases cannot be distinguished syntactically and have to both be valid.

Actually... this is necessary because a workflow that uses a workflow call will need a runs-on to be picked up by the runner. Otherwise it will not. The workflow that is re-used also needs a runs-on although it may not be necessary in some cases: - Not necessary if it is called from another workflow with the `workflow_call` event - Necessary if it is called because it is triggered by a push event The two cases cannot be distinguished syntactically and have to both be valid.
earl-warren changed title from fix: runs-on is also mandatory for reusable workflows to fix: runs-on is also mandatory for reusable workflows and may be needing container 2025-07-26 10:29:42 +00:00
Author
Contributor

forgejo/end-to-end#839 was manually run ahead of time to verify it passes.

image

https://code.forgejo.org/forgejo/end-to-end/pulls/839 was manually run ahead of time to verify it passes. ![image](/attachments/d49f87b5-af96-42f2-beea-6f7a0e394a04)
125 KiB
earl-warren changed title from fix: runs-on is also mandatory for reusable workflows and may be needing container to fix: runs-on is also mandatory for reusable workflows and may be needing container [skip cascade] 2025-07-26 10:46:51 +00:00
earl-warren force-pushed wip-workflow-call from 50c850d757
All checks were successful
/ cascade (pull_request_target) Successful in 1m31s
checks / unit (pull_request) Successful in 1m32s
checks / integration (pull_request) Successful in 2m53s
to 736fbff925
All checks were successful
/ cascade (pull_request_target) Has been skipped
checks / unit (pull_request) Successful in 1m46s
checks / integration (pull_request) Successful in 1m53s
2025-07-26 10:46:56 +00:00
Compare
Author
Contributor

Waiting on forgejo/end-to-end#839 to be merged to confirm the end-to-end test passes.

Waiting on https://code.forgejo.org/forgejo/end-to-end/pulls/839 to be merged to confirm the end-to-end test passes.
earl-warren force-pushed wip-workflow-call from 736fbff925
All checks were successful
/ cascade (pull_request_target) Has been skipped
checks / unit (pull_request) Successful in 1m46s
checks / integration (pull_request) Successful in 1m53s
to 08f21a5bf3
All checks were successful
/ cascade (pull_request_target) Has been skipped
checks / unit (pull_request) Successful in 2m6s
checks / integration (pull_request) Successful in 2m16s
2025-07-26 11:27:25 +00:00
Compare
earl-warren changed title from fix: runs-on is also mandatory for reusable workflows and may be needing container [skip cascade] to fix: runs-on is also mandatory for reusable workflows and may be needing container 2025-07-26 11:27:54 +00:00
earl-warren force-pushed wip-workflow-call from 08f21a5bf3
All checks were successful
/ cascade (pull_request_target) Has been skipped
checks / unit (pull_request) Successful in 2m6s
checks / integration (pull_request) Successful in 2m16s
to 54ca9dbb47
Some checks failed
checks / unit (pull_request) Successful in 2m7s
checks / integration (pull_request) Successful in 2m20s
/ cascade (pull_request_target) Failing after 30s
2025-07-26 11:28:00 +00:00
Compare
viceice approved these changes 2025-07-26 11:28:17 +00:00
@ -1474,1 +1474,4 @@
},
"runs-on": {
"type": "runs-on",
"required": true

wouldn't this break existing workflows if it's required? 🤔

I still don't understand why it's needed, but will approve. can be fixed later

wouldn't this break existing workflows if it's required? 🤔 I still don't understand why it's needed, but will approve. can be fixed later
Author
Contributor

It is required as of a few runner versions ago. The default value when it is not specified is undocumented and lead to various breakage. It was decided to not support a default value (based on what?). This is therefore not a breaking change but rather a clearer error message than the often difficult/obscure consequences of what happens when a runs-on is not specified.

In GitHub there is a limited number of runs-on and their semantic is tightly controlled by the server. Forgejo Actions grants a lot more flexibility and the interpretation is left to the runner ultimately. In that context figuring out a sane semantic for when runs-on is not specified would require thinking. I'm not saying it is not possible, but it definitely is not trivial.

Does that make sense?

It is required as of a few runner versions ago. The default value when it is not specified is undocumented and lead to various breakage. It was decided to not support a default value (based on what?). This is therefore not a breaking change but rather a clearer error message than the often difficult/obscure consequences of what happens when a `runs-on` is not specified. In GitHub there is a limited number of runs-on and their semantic is tightly controlled by the server. Forgejo Actions grants a lot more flexibility and the interpretation is left to the runner ultimately. In that context figuring out a sane semantic for when `runs-on` is not specified would require thinking. I'm not saying it is not possible, but it definitely is not trivial. Does that make sense?
Contributor

cascading-pr updated at forgejo/runner#738

cascading-pr updated at https://code.forgejo.org/forgejo/runner/pulls/738
Contributor

cascading-pr updated at forgejo/runner#738

cascading-pr updated at https://code.forgejo.org/forgejo/runner/pulls/738
earl-warren deleted branch wip-workflow-call 2025-07-26 12:24:42 +00:00
Commenting is not possible because the repository is archived.
No reviewers
No milestone
No project
No assignees
3 participants
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/act!194
No description provided.