Github Actions 🐙
Add a line break between each root-level block.
# Bad name: Build on: push env: DOCKER_IMAGE: $ # Good name: Build on: push env: DOCKER_IMAGE: $
Add a line break between each job step.
Name workflow files following the pattern
environmentcan be omitted if the workflow does not vary per environment.
# Bad ├── ci.yml ├── run_all_tests.yml ├── prod_deploy.yml ├── docker_test.yml # Good ├── test.yml ├── deploy.yml ├── deploy_production.yml ├── deploy_staging.yml ├── test_docker_build.yml
The name attribute for job must be provided as this is the value which will be used in the web UI.
# Bad jobs: publish: runs-on: ubuntu-latest # Good jobs: publish: name: Publish Docker Image runs-on: ubuntu-latest
The name attribute jobs set must be provided and follow the pattern “Verb description”. Start with a verb so there is a clear expectation of what the step is for.
In the step block with
run, prefer using a command with single line format.
# Bad - name: All using commands run: | echo "command no.1" >> .env # Good - name: All using commands run: echo "command no.1" >> .env
And for multi-line commands, prefer using the literal block scalar
|which preserves new lines and trailing spaces.
- name: All using commands run: | echo "command no.1" >> .env echo "command no.2" >> .env echo "command no.3" >> .env