06. Github actions Events
GitHub Events คือการแจ้งเตือนหรือสัญญาณที่เกิดขึ้นเมื่อมีอะไรบางอย่างเกิดขึ้น ใน repository
ตัวอย่าง Events ที่พบบ่อย: push - เมื่อมีการ push code pull_request - เมื่อสร้าง/แก้ไข PR issues - เมื่อสร้าง/ปิด issue release - เมื่อสร้าง release ใหม่ fork - เมื่อมีคน fork repo
Events ก็คือส่วนที่เราใช้ที่ on:
น่ะแหละ

เดี๋ยวรายละเอียดเชิงลึกเราจะไปดูกันในหัวข้อหลังๆนะ
สามารถไปดูเพิ่มเติมได้ที่ Github Actions Events
แต่ก็เอามาให้ดูบางตัวตามนี้
graph LR subgraph "Repository Related Events" A[push] --> |triggers| Action1[GitHub Action] B[pull_request] --> |triggers| Action1 D[create] --> |triggers| Action1 F[fork] --> |triggers| Action1 G[release] --> |triggers| Action1 H["watch (starred)"] --> |triggers| Action1 I[issues] --> |triggers| Action1 O[More] --> |triggers| Action1 end classDef repoEvents fill:#e1f5fe,stroke:#01579b,stroke-width:2px classDef actionBox fill:#fff3e0,stroke:#e65100,stroke-width:3px class A,B,C,D,E,F,G,H,I,J,K,L,M,N,O repoEvents class Action1,Action2 actionBox
graph LR subgraph "Other Events" P["schedule (cron)"] --> |triggers| Action2[GitHub Action] Q[workflow_dispatch] --> |triggers| Action2 R["repository_dispatch (REST API triggers)"] --> |triggers| Action2 S["workflow_call (call by other workflows)"] --> |triggers| Action2 AA[More] --> |triggers| Action2 end classDef otherEvents fill:#f3e5f5,stroke:#4a148c,stroke-width:2px classDef actionBox fill:#fff3e0,stroke:#e65100,stroke-width:3px class P,Q,R,S,T,U,V,W,X,Y,Z,AA otherEvents class Action1,Action2 actionBox