Support for reusable workflows - workflow_call - workflow_dispatch #63

Open
opened 2023-07-20 08:33:08 +00:00 by diem · 5 comments

Hello,
First of all thanks for the awesome work.
I've found out that forgejo-runner doesn't support "reusable workflows" (https://docs.github.com/en/actions/using-workflows/reusing-workflows) , which I believe is really helpful reducing code duplication across many repositories in a Forgejo instance.

I couldn't find any roadmap of planned features for the runner, so I'm filling this issue as feature request. Please let me know if there are better methods for tracking it.

example:

reusable.yml

name: Reusable workflow example

on:
  workflow_call:
    inputs:
      config-path:
        required: true
        type: string
    secrets:
      token:
        required: true

jobs:
  reusable:
    runs-on: docker
    steps:
    - run: |
        echo == config-path: ${{ inputs.config_path }}
        echo == repo-token: ${{ secrets.token }}

caller.yml

on: [ workflow_dispatch ]
jobs:
  call-workflow-passing-data:
    uses: ./reusable.yml
    with:
      config-path: ./somewhere/myconfig
    secrets:
      token: ${{ secrets.MYTOKEN}}
Hello, First of all thanks for the awesome work. I've found out that forgejo-runner doesn't support "reusable workflows" (https://docs.github.com/en/actions/using-workflows/reusing-workflows) , which I believe is really helpful reducing code duplication across many repositories in a Forgejo instance. I couldn't find any roadmap of planned features for the runner, so I'm filling this issue as feature request. Please let me know if there are better methods for tracking it. example: reusable.yml ``` name: Reusable workflow example on: workflow_call: inputs: config-path: required: true type: string secrets: token: required: true jobs: reusable: runs-on: docker steps: - run: | echo == config-path: ${{ inputs.config_path }} echo == repo-token: ${{ secrets.token }} ``` caller.yml ``` on: [ workflow_dispatch ] jobs: call-workflow-passing-data: uses: ./reusable.yml with: config-path: ./somewhere/myconfig secrets: token: ${{ secrets.MYTOKEN}} ```
earl-warren added the
Kind/Feature
label 2023-07-20 08:39:18 +00:00
Owner

Although it is not really the same, I found local actions a useful substitute to this missing feature.

https://forgejo.org/docs/v1.20/user/actions/#local-actions

Although it is not really the same, I found local actions a useful substitute to this missing feature. https://forgejo.org/docs/v1.20/user/actions/#local-actions
Author

@earl-warren Thanks for the heads up.
I'm working around it to see if it works in my case until the feature is implemented. Have to get around strategy: matrix but should be doable with few lines copy&paste (way better than copying a few workflows to almost every repository).

@earl-warren Thanks for the heads up. I'm working around it to see if it works in my case until the feature is implemented. Have to get around `strategy: matrix` but should be doable with few lines copy&paste (way better than copying a few workflows to almost every repository).
Owner

It would be great to have documentation for strategy: matrix if you can spare the time to update the documentation with that.

It would be great to [have documentation](https://forgejo.org/docs/v1.20/user/actions/) for `strategy: matrix` if you can spare the time to [update the documentation with that](https://codeberg.org/forgejo/website/src/branch/main/src/pages/docs/v1.20/user/actions.md).
Owner

There are fixes in ACT v1.20.0 which will be in the runner 3.4.0 release that should help. Tests should be written to https://code.forgejo.org/forgejo/end-to-end/actions to run a scenario that shows it actually works.

There are fixes in ACT v1.20.0 which will be in the runner 3.4.0 release that should help. Tests should be written to https://code.forgejo.org/forgejo/end-to-end/actions to run a scenario that shows it actually works.
Owner
https://github.com/go-gitea/gitea/pull/28163 is needed server side.
earl-warren changed title from Support for reusable workflows to Support for reusable workflows - workflow_call 2024-03-24 13:43:45 +00:00
earl-warren changed title from Support for reusable workflows - workflow_call to Support for reusable workflows - workflow_call - workflow_dispatch 2024-03-24 13:44:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 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#63
No description provided.