mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-12 02:24:21 -05:00
Actions - Manually trigger a workflow/action #10497
Closed
opened 2025-11-02 09:09:23 -06:00 by GiteaMirror
·
23 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.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-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#10497
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghnp5 on GitHub (Mar 23, 2023).
Feature Description
Hey!
It would be very nice if we could have a button here to trigger a specific workflow/action:
So that I could trigger a job quickly, without having to push or waiting for a schedule.
Thanks!!
Screenshots
No response
@andysh-uk commented on GitHub (Mar 23, 2023):
This would be great. GitHub’s actions has a “on: workflow_dispatch” directive which enables a button in the UI to trigger it manually:
https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow#running-a-workflow
However I have found in Gitea, if you navigate to an action that ran, there is a “re-run” button you can use to trigger it again.
@ghnp5 commented on GitHub (Apr 20, 2023):
This seems to be for single steps, only.
Unfortunately, there doesn't seem to be a way to re-run the whole workflow, unless I push a change.
@andysh-uk commented on GitHub (Apr 25, 2023):
This button works for a job I believe: a job being an entry in the .yaml file with multiple steps.
In mine, all my steps are in a single job within the same .yaml file, so clicking the re-run button runs all steps in the job (workflow).
If you have each step in separate jobs, or separate .yaml files, then you'd need to combine them into the same job I guess.
@ghnp5 commented on GitHub (Apr 25, 2023):
Hi @andysh-uk - yep, exactly.
I have several stages in the same yaml file, so I see multiple "re-run" buttons.
At the moment, I'm running one by one, but I'm hoping this will not be the long-term solution.
@andysh-uk commented on GitHub (Apr 25, 2023):
Hi @ghnp5, when you say "stages" are these jobs or steps?
As you can see in my screenshot, I have several steps within a single job, so I only have one re-run button.
If you have several jobs, can you combine the steps of each job into one, so you also only have one re-run button, or is there a reason they need to be separate jobs, and not just steps within a single job?
@ghnp5 commented on GitHub (Apr 25, 2023):
When I say stages, I mean multiple of your equivalent of
Deploy-Website-Production:.I have a quite complex workflow, that also uses
strategy matrix, etc, so it would be very limiting/troublesome to be merging all into the same stage/job.And we should not have to accommodate (or limiting ourselves) for something that should be an easy "fix" (to add a button to re-run all) 🙂 , hopefully!!
@andysh-uk commented on GitHub (Apr 25, 2023):
Thanks @ghnp5 I thought it would be something more complex, but thought I'd check.
This is a first release so for (relatively) simple things, it works great. I've completely replaced my TeamCity instance with it. I use it for deploying web apps from Git to Linux servers over SSH, running deployments commands over SSH, building Go applications and publishing them straight to S3.
I don't know if this would work in Gitea or your scenario (and I have zero experience with GH Actions) but could you have a workflow that calls your other workflows as each step? So you'd have one "master" workflow with a single job, and multiple steps, that just calls your other ones, which you could then trigger?
https://docs.github.com/en/actions/using-workflows/reusing-workflows
@ghnp5 commented on GitHub (Apr 25, 2023):
Thanks. I might explore this more and more, as we go!
As soon as Actions was released, I went ahead and created this first Action (never worked with GH Actions before), and I already had a lot of challenges in the process, but glad I got it working at the end, anyway!
Well done to Gitea Developers who worked on this!
I'm giving them time, anyway, to slowly make the improvements we've all been suggesting.
Worst case scenario, I'll automate some "dummy commit" (increase a number in a file or so), to run everything manually.
The only reason I'm running manually at the moment is because
scheduledoesn't work yet, actually.@pangliang commented on GitHub (Aug 18, 2023):
Self-owned images are based on other image versions. When the dependent image releases a new version, I usually use this function to trigger a new build to use the new dependent version
@nouknouk commented on GitHub (Aug 24, 2023):
On my side i created a brand new repository
ops/test2, with one action.gitea/workflows/test.ymllike belowbut I don't have any button to trigger the action (which has new ran before)
@ghnp5 commented on GitHub (Aug 25, 2023):
Yeah, there's no way to manually trigger the action, yet.
Only if you have an automatic trigger based on changing the YAML file, etc.
There is a "Re-run all jobs", but not a "Create New Run" or equivalent.
Note also that
workflow_dispatchis ignored on Gitea.@webvalera96 commented on GitHub (Oct 14, 2023):
yes, but i think this feature will be very cool
@ParadiseFallen commented on GitHub (Oct 16, 2023):
+1
@deurk commented on GitHub (Oct 17, 2023):
+1
@bencurio commented on GitHub (Oct 17, 2023):
+1 🚀
@denyskon commented on GitHub (Oct 17, 2023):
Please stop posting these
+1messages, they don't help anyone. If you'd like something to be implemented, please use reactions to upvote the main issue, do not spam it with your comments. Everybody who contributes to Gitea does it voluntarily in their free time.@denyskon commented on GitHub (Oct 17, 2023):
For those who need a workaround, use
on: issue_commentand create a specific issue where you'd comment to trigger a workflow run :)@bencurio commented on GitHub (Oct 18, 2023):
Thanks for the suggestion for the
issue_commentaction, I made a working example based on it.The problem is that
issue_commenttriggers a CI JOB on all project related comments, so this is inefficient. To work around this, I put a filter condition on each job so that the job only starts if the comment is exactly!actions run buildor!actions run testor!actions run allThe entire CI process runs even if the action is
pushorpull_request, or if the comment is!actions run allUnfortunately, the CI process is triggered by every project comment, but quickly stops due to filtering.
Starting CI job via API request:
Happy hacking.
@scovillo commented on GitHub (Mar 2, 2024):
For those who would prefer another solution than the "issue_comment trigger", I make use of the "paths" feature.

Setup a folder in your project (e.g. "trigger"), which includes a file (e.g. "name-of-manual-ci-job") and is reserved for triggering the "manual" ci job.
For example:
Setup your job running on a specific paths event:
You can also filter this event on other jobs:
To start a "manual" ci job via commit, just commit and push a modification of the referring ci job file in the trigger folder, e. g.
Hope this helps someone.
Thanks for the great work on gitea, I love it and use it for years!
@Sharaf5 commented on GitHub (Jun 21, 2024):
Any update ?
@akashkroy commented on GitHub (Jun 28, 2024):
Does
workflow_runwork ?@yinheli commented on GitHub (Jul 18, 2024):
Is there any API for triggering actions?
@lunny commented on GitHub (Aug 14, 2024):
Please follow #28163