Write and edit GitHub Actions workflow files. Use when creating new workflows, editing existing .github/workflows/*.yml files, or setting up CI/CD pipelines...
Write clear, minimal GitHub Actions workflow files.
run steps that are self-explanatory from the command itselfuses steps for common, obvious actions like:actions/checkoutactions/setup-nodeoven-sh/setup-bunpnpm/action-setupactions/cacheuses steps with actions/github-script (explain what the script does)jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun run build
- run: bun test
- name: Post build status to Slack
uses: actions/github-script@v7
with:
script: |
const webhook = process.env.SLACK_WEBHOOK;
// ... complex logic
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Build project
run: bun run build
- name: Run tests
run: bun test
@v4, not @main)workflow_dispatch for manual triggers when usefulpermissions to follow least privilegeconcurrency to cancel redundant runs${{ github.token }} over PAT when possible$GITHUB_STEP_SUMMARY to output execution results in Markdown format- name: Report test results
run: |
echo "## Test Results" >> $GITHUB_STEP_SUMMARY
echo "| Suite | Passed | Failed |" >> $GITHUB_STEP_SUMMARY
echo "|-------|--------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Unit | 42 | 0 |" >> $GITHUB_STEP_SUMMARY