go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
43.38k stars 5.33k forks source link

Gitea Workflow Trigger "release" doesn't trigger when release published by another workflow #31298

Open cored0wn opened 1 month ago

cored0wn commented 1 month ago

Description

When publishing a release via workflow action, I expect that it will trigger an release event (type: published) Unfortunately this is not the case.

It only triggers if I create a release manually.

Example workflow

name: Test release trigger event
run-name: Check if release trigger works
on:
  release:
    types: [published]

jobs:
  deploy-release:
    runs-on: ubuntu-latest
    steps:
      - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."

Example workflow as well a workflow which will create a release if a tag is published can be found on my demo repository

Gitea Version

1.21.11

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

official docker container

How are you running Gitea?

Self hosted but I managed to recreate the issue on the demo [gitea instance]((https://demo.gitea.com/twittor/demo)

Database

None

cored0wn commented 1 month ago

It seems that https://github.com/go-gitea/gitea/issues/28474 adressed the same issue. My workflows are in the correct directory as you can see in my repository.

lunny commented 1 month ago

By design, an event done by action-user will not be triggered. i.e. Creating an issue comment on an action will not trigger comment event because otherwise, it will result in a dead cycle.

cored0wn commented 1 month ago

Oh, I didn't know that and also the documentation doesn't mention it. This is probably the wrong place for this question, but is there a way around it?

lunny commented 1 month ago

Yes, it's undocumented. I marked this as docs type then it should be fixed in https://gitea.com/gitea/docs