Update contexts.yml #240
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: Context testing | |
on: | |
issue_comment: | |
types: [created, deleted, edited] | |
issues: | |
# types: [opened, edited, milestoned, assigned] | |
release: | |
types: [created, edited] | |
push: | |
pull_request: | |
workflow_call: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
tags: | |
description: 'Test scenario tags' | |
default: 'test' | |
color: | |
description: 'color' | |
default: 'blue' | |
env: | |
my-var: 1 | |
jobs: | |
write_contexts_to_log: | |
runs-on: ubuntu-latest | |
steps: | |
- name: print debug y/n | |
run: | | |
echo $RUNNER_DEBUG | |
printenv | |
- name: print cache | |
run: Get-ChildItem -Path $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE -Recurse | |
shell: pwsh | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
# - name: Write GitHub context to log | |
# id: github_context_step | |
# run: echo '${{ toJSON(github) }}' | |
- name: Write GitHub context to log | |
env: | |
GITHUB_CONTEXT: ${{ toJSON(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: Write job context to log | |
env: | |
JOB_CONTEXT: ${{ toJSON(job) }} | |
run: echo "$JOB_CONTEXT" | |
# - name: Write jobs context to log (reusable workflows) | |
# env: | |
# JOB_CONTEXT: ${{ toJSON(jobs) }} | |
# run: echo "$JOBS_CONTEXT" | |
- name: Write steps context to log | |
env: | |
STEPS_CONTEXT: ${{ toJSON(steps) }} | |
run: echo "$STEPS_CONTEXT" | |
- name: Write runner context to log | |
env: | |
RUNNER_CONTEXT: ${{ toJSON(runner) }} | |
run: echo "$RUNNER_CONTEXT" | |
- name: Write strategy context to log | |
env: | |
STRATEGY_CONTEXT: ${{ toJSON(strategy) }} | |
run: echo "$STRATEGY_CONTEXT" | |
- name: Write matrix context to log | |
env: | |
MATRIX_CONTEXT: ${{ toJSON(matrix) }} | |
run: echo "$MATRIX_CONTEXT" | |
- name: Write env context to log | |
env: | |
ENV_CONTEXT: ${{ toJSON(env) }} | |
run: echo "$ENV_CONTEXT" | |
- name: Write secrets context to log | |
env: | |
SECRETS_CONTEXT: ${{ toJSON(secrets) }} | |
run: echo "$SECRETS_CONTEXT" | |
- name: issue author | |
run: echo "${{ github.event.issue.user.login }}" | |
- name: echo release body | |
run: echo "${{ github.event.release.body }}" | |
- name: echo issue comment body | |
run: echo "$comment_body" | |
env: | |
comment_body: ${{ github.event.comment.body }} | |
- name: echo issue comment body again | |
run: echo "${{ github.event.comment.body }}" | |
- name: echo user | |
run: echo "${{ github.event.comment.user.login }}" | |
- name: check if approved | |
if: false | |
run: | | |
echo "looking to see if ${{ github.event.comment.user.login }} is in the approver team" | |
users=$(curl -sLX GET 'https://api.github.com/orgs/joshjohanning-org/teams/approver-team/members' \ | |
--header "Accept: application/vnd.github.v3+json" \ | |
--header "Authorization: Bearer ${{ secrets.GHEC_ADMIN_TOKEN }}" | jq -c '.[].login') | |
echo $users | grep -q ${{ github.event.comment.user.login }} && echo "Found ${{ github.event.comment.user.login }} in users" || echo "::warning title=not_approved::user is not in the approver team" | |
- name: print inputs | |
run: | | |
echo "${{ toJson(github.event.inputs) }}" | |
environment-job: | |
runs-on: ubuntu-latest | |
environment: dev | |
if: false | |
steps: | |
- name: Write GitHub context to log | |
id: github_context_step | |
run: echo '${{ toJSON(github) }}' | |
- name: Write job context to log | |
run: echo '${{ toJSON(job) }}' | |
- name: Write steps context to log | |
run: echo '${{ toJSON(steps) }}' | |
- name: Write runner context to log | |
run: echo '${{ toJSON(runner) }}' | |
- name: Write strategy context to log | |
run: echo '${{ toJSON(strategy) }}' | |
- name: Write matrix context to log | |
run: echo '${{ toJSON(matrix) }}' | |