...
Give every step a name. Use sentence casing:
Build and upload the results report
. These can be longer than 5 words.Leave a blank line between steps.
Commands
Always use YAML multi-line strings for shell commands, to simplify quoting:
Instead of this:
Code Block language yaml # BAD! This won't parse! command: bash -c "./manage.py blah_blah --extra \"{'offset_time': '2023-06-14T04:20:00'}\""
Use this:
Code Block language yaml command: | bash -c "./manage.py blah_blah --extra \"{'offset_time': '2023-06-14T04:20:00'}\""
Example
Code Block | ||
---|---|---|
| ||
name: "Nightly Unit Tests" on: push: branches: - "**/*nightly*" schedule: # Run at 2:22am early every morning Eastern time (6/7:22 UTC) # https://crontab.guru/#22_7_%2a_%2a_%2a - cron: "22 7 * * *" workflow_dispatch: defaults: run: shell: bash permissions: contents: read concurrency: group: "${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: true jobs: tests: name: "Python ${{ matrix.python-version }} tests" runs-on: ubuntu-20.04 strategy: matrix: python-version: - "3.8" - "3.11" steps: - name: "Check out the repo" uses: "actions/checkout@v3" - name: "Set up Python" uses: "actions/setup-python@v4" with: python-version: "${{ matrix.python-version }}" |
...