GitHub 官方新手篇:GitHub Actions 入門,用 YAML 做第一個自動化工作流
GitHub for Beginners: Getting started with GitHub Actions
摘要分析
GitHub for Beginners 系列第三季(2026-03-16)介紹內建的 CI/CD 平台 GitHub Actions:工作流是 repo 裡的 YAML 檔,由 push、PR、排程等事件觸發,在 hosted runner 上執行 job,每個 job 由 shell 指令或 Marketplace action 步驟組成。範例是新 issue 自動貼 triage 標籤:在 .github/workflows 建 .yml、設觸發與最小權限、用 gh CLI 貼標籤,合併後開測試 issue 驗證,再到 Actions 分頁看日誌、重跑或停用。免費額度適合個人練習。
- 在 .github/workflows/ 建 .yml 檔
- 設 on: 觸發事件、jobs 的 runs-on: ubuntu-latest、最小 permissions
- steps 用 actions/checkout 與 run: gh issue edit 貼標籤(GITHUB_TOKEN 內建)
- 合併到預設分支後開測試 issue 驗證
- Actions 分頁看日誌、重跑、停用
In season three of GitHub for Beginners (Kedasha Kerr, 2026-03-16), this post introduces GitHub Actions, the CI/CD and automation platform built into GitHub. Workflows are YAML files stored in the repository, triggered by events such as pushes, pull requests or schedules, executed on hosted runner virtual machines, and made of jobs whose steps are shell commands or prebuilt Marketplace actions. The walkthrough builds a workflow that automatically adds a 'triage' label to newly opened issues: create a .yml under .github/workflows, set a name, an on trigger for issue creation, runs-on: ubuntu-latest with only issues: write permission, add a checkout step and a run step that uses the GitHub CLI with the built-in token (the label must already exist), then merge to the default branch, open a test issue, and use the Actions tab to inspect logs, rerun or disable it.
- Create a .yml in .github/workflows
- Define on trigger, runs-on and minimal permissions
- Use actions/checkout and gh CLI with GITHUB_TOKEN
- Merge then open a test issue
- Inspect, rerun or disable in the Actions tab
關鍵字:GitHub ActionsCI/CDYAML自動化新手
來源原文:https://github.blog/developer-skills/github/github-for-beginners-getting-started-with-github-actions/
本頁為報導內容的摘要與分析,版權屬原媒體所有;請以原文為準。
