Trigger Action with an API call

The API docs are currently not working (I get a 404), but I’d like to know if is it possible to trigger an Action/Workflow without having to login to Gitea manually.

For example, some cronjob to make a POST call to Gitea, to invoke Action XYZ in repository ABC.

Is this possible?

Thanks!

1 Like

I am also looking for such a feature. There is a workaround mentioned here: Actions - Manually trigger a workflow/action · Issue #23668 · go-gitea/gitea · GitHub

Thanks. Do you mean the “comment on issue” workaround?
Yeah, I’d like something more direct, and that doesn’t write unnecessary “junk” in the database :slight_smile:
But that’s definitely something that can be considered. Thank you.

I created a release trigger, works like a charm. But it depends on your need.

Hey - what do you mean with “release trigger”? Maybe it can work for me, but I don’t understand what you mean with that :slight_smile: thanks!

The latest version of gitea (currently 1.23.1) supports the trigger: workflow_dispatch. Unfortunately I haven’t seen any api support for it yet either.

But if you’re thinking about triggering the workflow from a cron job, then maybe you could use the schedule trigger?

name: My test workflow
on:
  workflow_dispatch:
  schedule:
    - cron: "@daily"
[...]

/B :slightly_smiling_face:

Thank you for the suggestion.
Yeah, I already use schedule and workflow_dispatch, for other Actions.

But for this one, I want a way to trigger on demand, programmatically, that’s not necessarily on a fixed schedule.

1 Like