Skip to content

Commit

Permalink
explore job names
Browse files Browse the repository at this point in the history
Signed-off-by: Rishav Dhar <[email protected]>
  • Loading branch information
rdhar committed Jan 2, 2025
1 parent b84b14d commit af37f92
Showing 1 changed file with 57 additions and 44 deletions.
101 changes: 57 additions & 44 deletions .github/workflows/tf_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,57 +28,70 @@ jobs:
- fail_data_source_error
- fail_format_diff
- fail_invalid_resource_type
tent:
- 1
- 2

steps:
- name: Echo context
env:
GH_JSON: ${{ toJson(github) }}
run: echo "$GH_JSON"
GH_JOB: ${{ toJson(job) }}
GH_JOB_NAME: ${{ github.jobs[github.job].name }}
GH_JOB_ID: ${{ github.jobs[github.job].id }}
run: |
echo "$GITHUB_JOB"
echo "$GH_JSON"
echo "$GH_JOB"
echo "$GH_JOB_NAME"
echo "$GH_JOB_ID"
echo "${{ github.jobs[github.job].name }}"
echo "${{ github.jobs[github.job].id }}"
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
# - name: Checkout repository
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# with:
# persist-credentials: false

- name: Setup Tofu
if: matrix.tool == 'tofu'
uses: opentofu/setup-opentofu@12f4debbf681675350b6cd1f0ff8ecfbda62027b # v1.0.4
with:
tofu_version: v1.8.8
tofu_wrapper: false
# - name: Setup Tofu
# if: matrix.tool == 'tofu'
# uses: opentofu/setup-opentofu@12f4debbf681675350b6cd1f0ff8ecfbda62027b # v1.0.4
# with:
# tofu_version: v1.8.8
# tofu_wrapper: false

- name: Setup Terraform
if: matrix.tool == 'terraform'
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
terraform_version: v1.9.8
terraform_wrapper: false
# - name: Setup Terraform
# if: matrix.tool == 'terraform'
# uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
# with:
# terraform_version: v1.9.8
# terraform_wrapper: false

- name: Provision TF
id: tf
continue-on-error: true
uses: ./
with:
working-directory: tests/${{ matrix.test }}
command: ${{ github.event.pull_request.merged && 'apply' || 'plan' }}
arg-lock: ${{ github.event.pull_request.merged }}
format: true
validate: true
tag-actor: never
comment-pr: ${{ matrix.tool == 'tofu' && 'always' || 'never' }}
tool: ${{ matrix.tool }}
# - name: Provision TF
# id: tf
# continue-on-error: true
# uses: ./
# with:
# working-directory: tests/${{ matrix.test }}
# command: ${{ github.event.pull_request.merged && 'apply' || 'plan' }}
# arg-lock: ${{ github.event.pull_request.merged }}
# format: true
# validate: true
# tag-actor: never
# comment-pr: ${{ matrix.tool == 'tofu' && 'always' || 'never' }}
# tool: ${{ matrix.tool }}

- name: Echo TF
run: |
echo "check-id: ${{ steps.tf.outputs.check-id }}"
echo "command: ${{ steps.tf.outputs.command }}"
echo "comment-id: ${{ steps.tf.outputs.comment-id }}"
echo "diff: ${{ steps.tf.outputs.diff }}"
echo "exitcode: ${{ steps.tf.outputs.exitcode }}"
echo "identifier: ${{ steps.tf.outputs.identifier }}"
echo "job-id: ${{ steps.tf.outputs.job-id }}"
echo "plan-id: ${{ steps.tf.outputs.plan-id }}"
echo "plan-url: ${{ steps.tf.outputs.plan-url }}"
echo "result: ${{ steps.tf.outputs.result }}"
echo "run-url: ${{ steps.tf.outputs.run-url }}"
echo "summary: ${{ steps.tf.outputs.summary }}"
# - name: Echo TF
# run: |
# echo "check-id: ${{ steps.tf.outputs.check-id }}"
# echo "command: ${{ steps.tf.outputs.command }}"
# echo "comment-id: ${{ steps.tf.outputs.comment-id }}"
# echo "diff: ${{ steps.tf.outputs.diff }}"
# echo "exitcode: ${{ steps.tf.outputs.exitcode }}"
# echo "identifier: ${{ steps.tf.outputs.identifier }}"
# echo "job-id: ${{ steps.tf.outputs.job-id }}"
# echo "plan-id: ${{ steps.tf.outputs.plan-id }}"
# echo "plan-url: ${{ steps.tf.outputs.plan-url }}"
# echo "result: ${{ steps.tf.outputs.result }}"
# echo "run-url: ${{ steps.tf.outputs.run-url }}"
# echo "summary: ${{ steps.tf.outputs.summary }}"

0 comments on commit af37f92

Please sign in to comment.