Skip to content

Commit

Permalink
refactor: declare job outputs and end of job (#619)
Browse files Browse the repository at this point in the history
Job outputs often reference the steps in the job, so it makes more sense to place the outputs after the steps they reference.
  • Loading branch information
hknutsen authored Dec 16, 2024
1 parent f394337 commit 209c454
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docker-acr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ jobs:
IMAGE: ${{ inputs.registry_name }}.azurecr.io/${{ inputs.repository }}:${{ inputs.tag }}
IMAGE_LATEST: ${{ inputs.registry_name }}.azurecr.io/${{ inputs.repository }}:latest

outputs:
image: ${{ env.IMAGE }}
image_latest: ${{ env.IMAGE_LATEST }}

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down Expand Up @@ -103,3 +99,7 @@ jobs:
context: ${{ inputs.working_directory }}
tags: ${{ env.IMAGE }},${{ env.IMAGE_LATEST }}
push: true

outputs:
image: ${{ env.IMAGE }}
image_latest: ${{ env.IMAGE_LATEST }}
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ jobs:
IMAGE: ${{ inputs.registry }}/${{ inputs.repository }}:${{ inputs.tag }}
IMAGE_LATEST: ${{ inputs.registry }}/${{ inputs.repository }}:latest

outputs:
image: ${{ env.IMAGE }}
image_latest: ${{ env.IMAGE_LATEST }}

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand All @@ -94,3 +90,7 @@ jobs:
context: ${{ inputs.working_directory }}
tags: ${{ env.IMAGE }},${{ env.IMAGE_LATEST }}
push: true

outputs:
image: ${{ env.IMAGE }}
image_latest: ${{ env.IMAGE_LATEST }}
14 changes: 7 additions & 7 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,6 @@ jobs:
shell: bash
working-directory: ${{ inputs.working_directory }}

outputs:
upload-outcome: ${{ steps.upload.outcome }}
artifact-id: ${{ steps.upload.outputs.artifact-id }}
plugin-cache-dir: ${{ steps.mkdir.outputs.plugin-cache-dir }}
cache-primary-key: ${{ steps.cache-restore.outputs.cache-primary-key }}
cache-save-outcome: ${{ steps.cache-save.outcome }}

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down Expand Up @@ -272,6 +265,13 @@ jobs:
path: ${{ steps.mkdir.outputs.plugin-cache-dir }}
key: ${{ steps.cache-restore.outputs.cache-primary-key }}

outputs:
upload-outcome: ${{ steps.upload.outcome }}
artifact-id: ${{ steps.upload.outputs.artifact-id }}
plugin-cache-dir: ${{ steps.mkdir.outputs.plugin-cache-dir }}
cache-primary-key: ${{ steps.cache-restore.outputs.cache-primary-key }}
cache-save-outcome: ${{ steps.cache-save.outcome }}

terraform-apply:
name: Terraform Apply
needs: terraform-plan
Expand Down

0 comments on commit 209c454

Please sign in to comment.