paulienleeuwenburgh is learning GitHub Actions #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: learn-github-actions | |
run-name: ${{ github.actor }} is learning GitHub Actions | |
on: [push] | |
jobs: | |
check-bats-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- run: npm install -g bats | |
- run: bats -v | |
- run: echo "running on this branch $GITHUB_REF" | |
dump_contexts_to_log: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: Dump job context | |
env: | |
JOB_CONTEXT: ${{ toJson(job) }} | |
run: echo "$JOB_CONTEXT" | |
- name: Dump steps context | |
env: | |
STEPS_CONTEXT: ${{ toJson(steps) }} | |
run: echo "$STEPS_CONTEXT" | |
- name: Dump runner context | |
env: | |
RUNNER_CONTEXT: ${{ toJson(runner) }} | |
run: echo "$RUNNER_CONTEXT" | |
- name: Dump strategy context | |
env: | |
STRATEGY_CONTEXT: ${{ toJson(strategy) }} | |
run: echo "$STRATEGY_CONTEXT" | |
- name: Dump matrix context | |
env: | |
MATRIX_CONTEXT: ${{ toJson(matrix) }} | |
run: echo "$MATRIX_CONTEXT" | |
- name: Display default variables | |
run: echo "this workflow $GITHUB_WORKFLOW was triggered by $GITHUB_ACTOR on the $GITHUB_REPOSITORY repo" | |
- name: condition 1 | |
if: runner.os == 'Windows' | |
run: echo "The operating system on the runner is $env:RUNNER_OS." | |
- name: condition 2 | |
if: runner.os != 'Windows' | |
run: echo "The operating system on the runner is not Windows, it's $RUNNER_OS." |