Skip to content

Trigger workflow B in a repo from workflow A in another repo #32041

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

Closed
AlterX76 opened this issue Sep 14, 2024 · 3 comments
Closed

Trigger workflow B in a repo from workflow A in another repo #32041

AlterX76 opened this issue Sep 14, 2024 · 3 comments
Labels
topic/gitea-actions related to the actions of Gitea type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@AlterX76
Copy link

Feature Description

On Github Actions, there is a possibility to trigger a workflow from another repository through an API call, so the idea is Workflow1 runs and once arrived at a given state, it calls the API to trigger Workflow2 from another repository.

Here is what is used on Github’s side, it relies on the on: workflow_dispatch event and a REST route letting the user generate a custom event. A discussion regarding this can be found here: Triggering by other repository · community · Discussion #26323 · GitHub 118

Screenshots

No response

@AlterX76 AlterX76 added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Sep 14, 2024
@yp05327 yp05327 added the topic/gitea-actions related to the actions of Gitea label Sep 17, 2024
@ChristopherHX
Copy link
Contributor

ChristopherHX commented Feb 6, 2025

Is this issue about repository_dispatch or workflow_dispatch? Both are somewhat similar, but not the same.

I'm working on recreating the workflow_dispatch api here https://github.com/ChristopherHX/gitea/pull/new/workflow-dispatch-api
Still need to cleanup (extract common code of UI and api into a common package, error handling is so differently) and testing

Based on https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event

curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http://localhost:3000/api/v1/repos/user5/repo4/actions/workflows/test.yml/dispatches \
  -d 'ref=refs/heads/master' -vv

curl -L \                                                                                            
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http://localhost:3000/api/v1/repos/user5/repo4/actions/workflows/test.yml/dispatches \
  -d '{"ref":"refs/heads/master","inputs":{}}' -vv -H "Content-Type: application/json"

@ChristopherHX
Copy link
Contributor

This seem to duplicate #31765 issue

@lunny
Copy link
Member

lunny commented Feb 6, 2025

Close as duplicate of #31765

@lunny lunny closed this as completed Feb 6, 2025
@go-gitea go-gitea locked as resolved and limited conversation to collaborators May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/gitea-actions related to the actions of Gitea type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants