Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: support for reusable workflows #826

Closed
catthehacker opened this issue Sep 26, 2021 · 9 comments · Fixed by #1093 or #1525
Closed

Issue: support for reusable workflows #826

catthehacker opened this issue Sep 26, 2021 · 9 comments · Fixed by #1093 or #1525
Labels
area/action Relating to running an action area/workflow Relating to workflow definitions kind/bug Something isn't working stale-exempt Exempt from stale

Comments

@catthehacker
Copy link
Member

catthehacker commented Sep 26, 2021

ref: github/roadmap#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 familiar uses syntax. Optionally, use inputs and outputs 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
@catthehacker catthehacker added kind/bug Something isn't working area/action Relating to running an action area/workflow Relating to workflow definitions stale-exempt Exempt from stale labels Sep 26, 2021
@catthehacker catthehacker self-assigned this Sep 26, 2021
@ChristopherHX
Copy link
Contributor

ChristopherHX commented Sep 30, 2021

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 ChristopherHX@efdc2fa 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 as needs of a job which depends on all other jobs in the reusable workflow

@brettcurtis
Copy link

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 !!

@catthehacker
Copy link
Member Author

https://github.blog/changelog/2021-11-24-github-actions-reusable-workflows-are-generally-available/

@alexsanderp

This comment has been minimized.

@catthehacker
Copy link
Member Author

That's because they are not supported

@kjbrak

This comment has been minimized.

@nektos nektos deleted a comment from KannappanSomu Jan 20, 2022
@larryclaman

This comment was marked as duplicate.

@catthehacker
Copy link
Member Author

catthehacker commented Feb 11, 2022

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.

@catthehacker catthehacker removed their assignment Feb 11, 2022
@lionslair

This comment was marked as spam.

@nektos nektos locked as spam and limited conversation to collaborators Feb 28, 2022
@catthehacker catthehacker linked a pull request Mar 30, 2022 that will close this issue
KnisterPeter added a commit that referenced this issue Dec 20, 2022
This changes adds cloning of a remote repository to
run a workflow included in it.

Closes #826
github-actions bot pushed a commit to xing/act that referenced this issue Dec 21, 2022
This changes adds cloning of a remote repository to
run a workflow included in it.

Closes nektos#826
github-actions bot pushed a commit to xing/act that referenced this issue Dec 21, 2022
This changes adds cloning of a remote repository to
run a workflow included in it.

Closes nektos#826
github-actions bot pushed a commit to xing/act that referenced this issue Dec 26, 2022
This changes adds cloning of a remote repository to
run a workflow included in it.

Closes nektos#826
github-actions bot pushed a commit to xing/act that referenced this issue Jan 2, 2023
This changes adds cloning of a remote repository to
run a workflow included in it.

Closes nektos#826
github-actions bot pushed a commit to xing/act that referenced this issue Jan 12, 2023
This changes adds cloning of a remote repository to
run a workflow included in it.

Closes nektos#826
github-actions bot pushed a commit to xing/act that referenced this issue Jan 13, 2023
This changes adds cloning of a remote repository to
run a workflow included in it.

Closes nektos#826
github-actions bot pushed a commit to xing/act that referenced this issue Jan 14, 2023
This changes adds cloning of a remote repository to
run a workflow included in it.

Closes nektos#826
github-actions bot pushed a commit to xing/act that referenced this issue Jan 16, 2023
This changes adds cloning of a remote repository to
run a workflow included in it.

Closes nektos#826
github-actions bot pushed a commit to xing/act that referenced this issue Jan 17, 2023
This changes adds cloning of a remote repository to
run a workflow included in it.

Closes nektos#826
@mergify mergify bot closed this as completed in #1525 Jan 19, 2023
mergify bot added a commit that referenced this issue Jan 19, 2023
* feat: add remote reusable workflows

This changes adds cloning of a remote repository to
run a workflow included in it.

Closes #826

* fix: defer plan creation until clone is done

We need wait for the full clone (and only clone once)
before we start to plan the execution for a remote workflow

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/action Relating to running an action area/workflow Relating to workflow definitions kind/bug Something isn't working stale-exempt Exempt from stale
Projects
None yet
7 participants