Update examples

This commit is contained in:
Peter Evans 2019-11-15 08:27:12 +09:00
parent 484d8bd85d
commit d17c882ef3

View file

@ -336,39 +336,42 @@ Alternatively, [`set-env`](https://help.github.com/en/github/automating-your-wor
### Debugging GitHub Actions ### Debugging GitHub Actions
#### Runner Diagnostic Logging
[Runner diagnostic logging](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/managing-a-workflow-run#enabling-runner-diagnostic-logging) provides additional log files that contain information about how a runner is executing an action.
To enable runner diagnostic logging, set the secret `ACTIONS_RUNNER_DEBUG` to `true` in the repository that contains the workflow.
#### Step Debug Logging #### Step Debug Logging
To enable [step debug logging](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/managing-a-workflow-run#enabling-step-debug-logging) set the secret `ACTIONS_STEP_DEBUG` to `true` in the repository that contains the workflow. [Step debug logging](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/managing-a-workflow-run#enabling-step-debug-logging) increases the verbosity of a job's logs during and after a job's execution.
To enable step debug logging set the secret `ACTIONS_STEP_DEBUG` to `true` in the repository that contains the workflow.
#### Output Various Contexts #### Output Various Contexts
```yml ```yml
- name: Dump event JSON steps:
env: - name: Dump GitHub context
EVENT_JSON_FILENAME: ${{ github.event_path }} env:
run: cat "$EVENT_JSON_FILENAME" GITHUB_CONTEXT: ${{ toJson(github) }}
- name: Dump GitHub context run: echo "$GITHUB_CONTEXT"
env: - name: Dump job context
GITHUB_CONTEXT: ${{ toJson(github) }} env:
run: echo "$GITHUB_CONTEXT" JOB_CONTEXT: ${{ toJson(job) }}
- name: Dump job context run: echo "$JOB_CONTEXT"
env: - name: Dump steps context
JOB_CONTEXT: ${{ toJson(job) }} env:
run: echo "$JOB_CONTEXT" STEPS_CONTEXT: ${{ toJson(steps) }}
- name: Dump steps context run: echo "$STEPS_CONTEXT"
env: - name: Dump runner context
STEPS_CONTEXT: ${{ toJson(steps) }} env:
run: echo "$STEPS_CONTEXT" RUNNER_CONTEXT: ${{ toJson(runner) }}
- name: Dump runner context run: echo "$RUNNER_CONTEXT"
env: - name: Dump strategy context
RUNNER_CONTEXT: ${{ toJson(runner) }} env:
run: echo "$RUNNER_CONTEXT" STRATEGY_CONTEXT: ${{ toJson(strategy) }}
- name: Dump strategy context run: echo "$STRATEGY_CONTEXT"
env: - name: Dump matrix context
STRATEGY_CONTEXT: ${{ toJson(strategy) }} env:
run: echo "$STRATEGY_CONTEXT" MATRIX_CONTEXT: ${{ toJson(matrix) }}
- name: Dump matrix context run: echo "$MATRIX_CONTEXT"
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"
``` ```