更新 .gitea/workflows/demo.yaml
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 45s
Details
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 45s
Details
添加合并请求,合并完的状态触发信息,发布生产
This commit is contained in:
parent
f0b837390a
commit
77efce977d
|
|
@ -1,6 +1,9 @@
|
|||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on:
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
types: [closed] # 当pull request被合并或关闭时触发。这包括两种情况:一是pull request被合并(merged),二是pull request被直接关闭(closed)
|
||||
push:
|
||||
branches: [ "main","releases/**" ]
|
||||
# paths:
|
||||
|
|
@ -46,6 +49,18 @@ jobs:
|
|||
echo "不包含"
|
||||
exit 1
|
||||
fi
|
||||
- name: Get commit message (Pull Request)
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
echo "是否是合并关闭的 $PR_STATUS_FLAG"
|
||||
pr_num=${{ github.event.pull_request.number }}
|
||||
git fetch origin refs/pull/${pr_num}/head:refs/remotes/origin/pull/${pr_num}/head
|
||||
commit_title=$(git log -1 --pretty=format:"%s" origin/pull/${pr_num}/head)
|
||||
commit_body=$(git log -1 --pretty=format:"%b" origin/pull/${pr_num}/head)
|
||||
echo "合并请求 Commit Title: $commit_title"
|
||||
echo "合并请求Commit Body: $commit_body"
|
||||
env:
|
||||
PR_STATUS_FLAG: ${{ github.event.pull_request.merged }}
|
||||
|
||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
||||
|
|
|
|||
Loading…
Reference in New Issue