创建流水线:上下文信息
Context testing / dump_contexts_to_log (push) Successful in 29s Details

This commit is contained in:
xxq250 2026-05-26 11:09:47 +08:00
parent 41579515e7
commit 69b6b3a8b3
1 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,58 @@
name: Context testing
on: push
jobs:
dump_contexts_to_log:
runs-on: ubuntu-latest
steps:
- run: echo "SELECTED_COLOR=green" >> "$GITHUB_ENV"
- run: echo "The selected color is ${{env.SELECTED_COLOR}}"
- 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"
echo "adsfsf=========${{ github.action }}"
- name: env
run: env
- name: Dump steps context
id: steps_context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: |
echo "$STEPS_CONTEXT"
echo "adsfsf=========${{ github.action }}"
echo "ACTIONS_RUNTIME_TOKEN====================${{ACTIONS_RUNTIME_TOKEN}}"
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Dump needs context
env:
NEEDS_CONTEXT: ${{ toJson(needs) }}
run: echo "$NEEDS_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: Dump steps context2
id: steps_context2
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: |
echo "$STEPS_CONTEXT"
echo "adsfsf=========${{ github.action }}"
echo "ACTIONS_RUNTIME_TOKEN====================${{ACTIONS_RUNTIME_TOKEN}}"
- name: Dump GitHub context2
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"