on是下拉多选框
- push
- pull_request
- on: workflow_dispatch 手动触发
- on create 创建分支或tag运行
- on delete 删除分支或标记
- on: discussion: types:[]
- created- edited- deleted- transferred- pinned- unpinned- labeled- unlabeled- locked- unlocked- category_changed - answered - unanswered
- 针对这些操作,当然需要过滤
- on: discussion_comment: types: [created, deleted]
- 针对的是评论
- on fork
- on issue_comment 对评论的操作
- on issues types
- opened- edited- deleted- transferred- pinned- unpinned- closed- reopened- assigned- unassigned- labeled- unlabeled- locked- unlocked- milestoned - demilestoned
- 对issues的操作
- on pull_request 里面也很复杂
- on pull_request_review ```yaml on: issue_comment: types: [created, deleted]
对于 comment 的操作,不是 pr 就是 comment
on: issue_comment
jobs: pr_commented:
# This job only runs for pull request comments
name: PR comment
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- run: |
echo "Comment on PR #${{ github.event.issue.number }}"
issue_commented:
# This job only runs for issue comments
name: Issue comment
if: ${{ !github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- run: |
echo "Comment on issue #${{ github.event.issue.number }}"
github.event
```javascript
var o={
name: "xx",
on: {
push: {
branches: ["master"],
},
pull_request: {
branches: ["master"],
},
schedule:[{
cron:'xxx'
}]
},
},
name: Weekly Team Sync
on:
schedule:
- cron: 20 07 * * 1
jobs:
create_issue:
name: Create team sync issue
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Create team sync issue
uses: imjohnbo/issue-bot@3daae12aa54d38685d7ff8459fc8a2aee8cea98b
with:
assignees: "monalisa, doctocat, hubot"
labels: "weekly sync, docs-team"
title: "Team sync"
body: |
### Agenda
- [ ] Start the recording
- [ ] Check-ins
- [ ] Discussion points
- [ ] Post the recording
### Discussion Points
Add things to discuss below
- [Work this week](https://github.com/orgs/github/projects/3)
pinned: false
close-previous: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Close issue
uses: actions-cool/issues-helper@v2.2.1
with:
actions: 'close-issue'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: xxx
body: 'This is auto closed.'