-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Close PR Trigger should be removed in some cases #23222
Comments
TBH, I noticed this "bug" early on, but didn't know how to fix it. It's not a good idea to remove the close PR trigger. Think about this, what if I want a workflow to add a comment to a PR automatically when the PR has been closed? |
So the default events for |
@wolfogre I found this document: Then I changed workflow yaml file: name: Gitea Actions Demo
run-name: ${{ github.actor }} is testing out Gitea Actions 🚀
on:
pull_request:
types: [opened]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}." |
This maybe fixed by #23037 |
I think it is possible to remove close PR trigger in some cases as default, such as close PRs, merge PRs(which will trigger close PR event), as if users want to trigger these close PR events, they can add |
Fixed by #23037 |
Description
I used both
push
andpull_request
in the workflow config yaml file.If you merge a PR, you will get two action tasks:
In
action_run
table, the record is as following:ref name is
pr.MergedCommitID
, and the event's action isclosed
gitea/services/actions/notifier.go
Line 337 in 7a5af25
It seems that Close PR Event will be triggered, when you merge a PR.
I don't think we need to trigger Close PR Event, as if a PR is closed without merge, this event will also be triggered:
Create a PR and just close it:
An action task will start to run:
And the action task name will be the latest commit name:
If we removed Close PR Trigger, when a PR is merged, the only Push Trigger will work.
Gitea Version
latest
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
build
Database
None
The text was updated successfully, but these errors were encountered: