act
act copied to clipboard
Issue: support for reusable workflows
ref: https://github.com/github/roadmap/issues/98
GitHub is going to support reusable workflows (similar to Azure DevOps Pipelines)
How will it work? To reuse a workflow, ensure it listens to a new
workflow_call
event trigger, and then reference it with the familiaruses
syntax. Optionally, useinputs
andoutputs
to pass data between them, just like with actions.For example:
name: Build & Release App on: push: jobs: build: uses: example-org/automation/workflows/build.yml@1 release: needs: build uses: example-org/automation/workflows/release.yml@1 with: artifact-url: jobs.build.outputs.artifact-url
I want to add someone found the beta documentation ( source ) https://docs.github.com/en/actions/learn-github-actions/reusing-workflows
I'm going to implement it in my own actions-service (runner.server)
It seems to be even deployed as beta. Far more information than in the roadmap.
EDIT 2021/10/28:
For reusable workflows it might be useful to backport the following commit https://github.com/ChristopherHX/act/commit/efdc2fa17528a643addc00009a2299d2f514da6d after my PR uses in composite
is merged
EDIT 2022/03/28
The commit mentioned in the previous edit has been merged via the uses in composite
and is already in v0.2.26
.
This issue has a low priority for me.
DONE:
- make inputs context available in the runcontext
TODO:
- obtain the reusable workflows in the planner
- evaluate the inputs and secrets
- only make evaluated secrets available in the reusable workflow
- assign the evaluated inputs to the runcontext of the reusable workflow
- evaluate workflow outputs and add the
jobs
context, the same asneeds
of a job which depends on all other jobs in the reusable workflow
We just started implementing reusable workflows. As I was going through the pains of several commits and merges leading to broken workflows I came across this repo! It was linked in the recent Thoughtworks Technology Radar. Anyways just here to say I'm looking forward to using it !!
https://github.blog/changelog/2021-11-24-github-actions-reusable-workflows-are-generally-available/
News?
I received an error when trying to use a reusable workflow by act:
ERRO[0000] 'runs-on' key not defined in Terraform Plan - Github Actions Runner/production
ERRO[0000] 'runs-on' key not defined in Terraform Plan - Github Actions Runner/production
ERRO[0000] 'runs-on' key not defined in Terraform Plan - Github Actions Runner/production
That's because they are not supported
Hi, I also get the following when trying to run a job that uses a reusable workflow:
time="2022-01-19T14:19:37+01:00" level=error msg="'runs-on' key not defined in <workflow_name to test>/<job_name>"
time="2022-01-19T14:19:37+01:00" level=error msg="'runs-on' key not defined in <workflow_name to test>/<job_name>"
time="2022-01-19T14:19:37+01:00" level=error msg="'runs-on' key not defined in <workflow_name to test>/<job_name>"
Any plans on implementing support for reusable workflows?
Hi, just wondering if support for reusable workflows is on the backlog for act? As I've started refactoring my workflows to support them, I found that unfortunately it broke my ability to use act for unit testing.
Hi, just wondering if support for reusable workflows is on the backlog for act?
Yes, that's why this issue is opened
--- EDIT ---
Issue is locked because none of recent responses are helpful at all. Please familiarise yourself with https://github.com/golang/go/wiki/NoPlusOne/ In case of this, we are aware of the reusable workflows (I raised the issue after all). If there will be any news regarding this issue, it will be updated and/or unlocked. If there will be an attempt at implementing it, its pull request will be linked. (Please feel free to contribute it) Please do not ask when is this going to be implemented. It's annoying and doesn't contribute at all.
Any Update?