- contexts (E.g.
${{ github.run_id }}
) - context availability
- expressions (E.g.
${{ hashFiles('**/pom.xml') }}
) - file patterns (E.g.
**/*
) - hosted runners label (E.g.
windows-latest
) - hosted runners environment
- computed matrix
uses: ./.github/actions/my-action
github.run_id
does not change when the workflow is re-run, however we can combine it with github.run_attempt
to get a unique id.
${{ github.run_id }}-${{ github.run_attempt }}
REPO="romain-grecourt/helidon-build-tools"
for id in `gh run list --json databaseId -q '.[].databaseId' -L 500 -R "${REPO}" | tail -150` ; do
echo $id ; gh api "repos/${REPO}/actions/runs/${id}" -X DELETE > /dev/null
done
Some context are only available at certain times. See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
Here are the context that can be used for a job name: github, needs, strategy, matrix, vars, inputs
cli:
needs: build
timeout-minutes: 15
strategy:
matrix:
os: [ ubuntu-20.04, windows-2022, macos-12 ]
include:
- os: ubuntu-20.04
platform: linux-amd64
- os: windows-2022
platform: windows-amd64
- os: macos-12
platform: darwin-amd64
runs-on: ${{ matrix.os }}
name: cli/${{ matrix.platform }}
env:
MAVEN_ARGS: |
${{ env.MAVEN_ARGS }}
-Dcache.createArchive=${{ inputs.build-cache == 'read-write' && 'true' || 'false' }}