Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
env:
EXAMPLE_VAR: 'Value'
with:
vars_context: ${{ toJson(vars) }}
secrets_context: ${{ toJson(secrets) }}
needs_context: ${{ toJson(needs) }}

Expand All @@ -40,6 +41,7 @@ jobs:
env:
EXAMPLE_VAR: 'Value'
with:
vars_context: ${{ toJson(vars) }}
secrets_context: ${{ toJson(secrets) }}
needs_context: ${{ toJson(needs) }}

Expand All @@ -56,6 +58,7 @@ jobs:
EXAMPLE_VAR: 'Value'
with:
contexts: 'env'
vars_context: ${{ toJson(vars) }}
secrets_context: ${{ toJson(secrets) }}
needs_context: ${{ toJson(needs) }}

Expand All @@ -72,6 +75,7 @@ jobs:
EXAMPLE_VAR: 'Value'
with:
contexts: 'github,env'
vars_context: ${{ toJson(vars) }}
secrets_context: ${{ toJson(secrets) }}
needs_context: ${{ toJson(needs) }}

Expand All @@ -84,6 +88,7 @@ jobs:
context:
- github
- env
- vars
- job
- steps
- runner
Expand All @@ -101,5 +106,6 @@ jobs:
EXAMPLE_VAR: 'Value'
with:
contexts: ${{ matrix.context }}
vars_context: ${{ toJson(vars) }}
secrets_context: ${{ toJson(secrets) }}
needs_context: ${{ toJson(needs) }}
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ This action prints actions contexts for debugging
with:
# Optional
# Specify which contexts to print
# Default: 'github,env,job,steps,runner,secrets,strategy,matrix,needs,inputs'
# Default: 'github,env,vars,job,steps,runner,secrets,strategy,matrix,needs,inputs'
contexts: ''

# Optional
# Provide vars context to action, as vars context is not available in composite workflows
# Default: null
vars_context: ${{ toJson(vars) }}

# Optional
# Provide secrets context to action, as secrets context is not available in composite workflows
# Default: null
Expand Down Expand Up @@ -45,6 +50,7 @@ job:
context:
- github
- env
- vars
- job
- steps
- runner
Expand All @@ -57,6 +63,7 @@ job:
- uses: henrygriffiths/debug_action@v1
with:
contexts: ${{ matrix.context }}
vars_context: ${{ toJson(vars) }}
secrets_context: ${{ toJson(secrets) }}
needs_context: ${{ toJson(needs) }}
```
Expand Down
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ inputs:
contexts:
description: 'Contexts to dump'
required: false
default: 'github,env,job,steps,runner,secrets,strategy,matrix,needs,inputs'
default: 'github,env,vars,job,steps,runner,secrets,strategy,matrix,needs,inputs'
vars_context:
description: 'Vars Context'
required: false
default: 'Vars Context not provided'
secrets_context:
description: 'Secrets Context'
required: false
Expand All @@ -26,6 +30,7 @@ runs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
ENV_CONTEXT: ${{ toJson(env) }}
VARS_CONTEXT: ${{ inputs.vars_context }}
JOB_CONTEXT: ${{ toJson(job) }}
STEPS_CONTEXT: ${{ toJson(steps) }}
RUNNER_CONTEXT: ${{ toJson(runner) }}
Expand Down
4 changes: 4 additions & 0 deletions debug_action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ do
echo -e "\033[1;33m>>>>>> Env Context\033[0m"
echo -e "$ENV_CONTEXT"
echo -e "\033[1;33m<<<<<< Env Context\033[0m"
elif [ $x == 'vars' ]; then
echo -e "\033[1;33m>>>>>> Vars Context\033[0m"
echo -e "$VARS_CONTEXT"
echo -e "\033[1;33m<<<<<< Vars Context\033[0m"
elif [ $x == 'job' ]; then
echo -e "\033[1;33m>>>>>> Job Context\033[0m"
echo -e "$JOB_CONTEXT"
Expand Down
Loading