Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1003 Bytes

gh-actions.md

File metadata and controls

39 lines (27 loc) · 1003 Bytes

GitHub Actions / Best practices

Specify timeout

The default timeout is 360 minutes which is most likely more than needed. Each job must have an explicit time constraint.

GOOD

name: Verify

on: [push]

jobs:
  test:
    runs-on: ubuntu-18.04
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v1

Print current ref

At the moment, when using on: [push] it's not possible to distingish an on-tag-push build from an on-commit-push build. There can be additional actions on a tag build, such as releasing. In this case, to make the difference clear in the logs, add a step to print the current ref.

GOOD

name: Verify

on: [push]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Show current ref
        run: echo ${{ github.ref }}