GitHub Actions
Workflow YAML lives in .github/workflows/.
Triggers
on: [push]- Run on push
on: pull_request- Run on PRs
on: workflow_dispatch- Manual run button
on: schedule: - cron: "0 2 * * *"- Scheduled run
Jobs & steps
runs-on: ubuntu-latest- Pick a runner
uses: actions/checkout@v4- Check out the repo
uses: actions/setup-dotnet@v4- Set up a toolchain
run: dotnet test- Run a shell command
needs: build- Depend on another job
Context
${{ secrets.TOKEN }}- Read a secret
${{ github.sha }}- Current commit SHA
if: github.ref == "refs/heads/main"- Conditional step