Actions 工作流

Trigger Events

on: pushTrigger on push
on: pull_requestTrigger on PR
on: schedule: cronScheduled trigger
on: workflow_dispatchManual trigger
on: release: types: [published]On release

Common Steps

actions/checkout@v4Check out repository
actions/setup-node@v4Setup Node.js
actions/setup-python@v5Setup Python
actions/cache@v4Cache dependencies
actions/upload-artifact@v4Upload build artifacts
github/codeql-actionCode security scan

Expressions

$${{ secrets.MY_SECRET }}#123;${{ secrets.MY_SECRET }}#123; secrets.MY_SECRET ${{ secrets.MY_SECRET }}#125;${{ secrets.MY_SECRET }}#125;Access secret
$${{ github.sha }}#123;${{ github.sha }}#123; github.sha ${{ github.sha }}#125;${{ github.sha }}#125;Commit SHA
if: github.ref == 'refs/heads/main'Condition on branch
needs: [build, test]Job dependencies
environment: productionDeployment environment