From bb1c1b1da55c389e7986e06a451acb13241ec3dc Mon Sep 17 00:00:00 2001 From: Callum Gare Date: Thu, 14 May 2026 11:39:08 +1000 Subject: [PATCH 1/5] fix: error when pushing tag with / --- actions/get-app-version/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/get-app-version/action.yaml b/actions/get-app-version/action.yaml index 022062a..db9a81e 100644 --- a/actions/get-app-version/action.yaml +++ b/actions/get-app-version/action.yaml @@ -12,7 +12,7 @@ runs: - name: Get app version id: get-app-version shell: bash - run: echo "app-version=${{ github.ref_name }}-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + run: echo "app-version=$(echo '${{ github.ref_name }}' | tr '/' '-')-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Print app version shell: bash From f1bc29530861b7aa93722ced93430b1a09b83b7f Mon Sep 17 00:00:00 2001 From: Callum Gare Date: Thu, 14 May 2026 11:40:05 +1000 Subject: [PATCH 2/5] feat: improve how tag info is displayed --- .github/workflows/build-docker-image.yaml | 2 +- .github/workflows/push-docker-image-to-ecr.yaml | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docker-image.yaml b/.github/workflows/build-docker-image.yaml index 7ba0a6b..36b188e 100644 --- a/.github/workflows/build-docker-image.yaml +++ b/.github/workflows/build-docker-image.yaml @@ -17,7 +17,7 @@ jobs: name: Build docker image runs-on: ubuntu-latest outputs: - image-name: ${{ steps.build-docker-image.outputs.app-version }} + image-name: ${{ steps.build-docker-image.outputs.image-name }} app-version: ${{ steps.get-app-version.outputs.app-version }} steps: - name: Checkout repository diff --git a/.github/workflows/push-docker-image-to-ecr.yaml b/.github/workflows/push-docker-image-to-ecr.yaml index 701843a..d7f7580 100644 --- a/.github/workflows/push-docker-image-to-ecr.yaml +++ b/.github/workflows/push-docker-image-to-ecr.yaml @@ -29,6 +29,11 @@ jobs: id: get-app-version uses: infoxchange/github-ci/actions/get-app-version@main + - name: Print info + shell: bash + run: | + echo "Preparing to push tag: ${{ steps.get-app-version.outputs.app-version }}" + - name: Load docker image id: load-docker-image uses: infoxchange/github-ci/actions/setup-docker-image@main @@ -57,5 +62,8 @@ jobs: docker tag ${{ steps.load-docker-image.outputs.image-name }}:latest $ECR_REGISTRY/${{ inputs.ecr-image-name }}:${{ steps.get-app-version.outputs.app-version }} docker push $ECR_REGISTRY/${{ inputs.ecr-image-name }}:${{ steps.get-app-version.outputs.app-version }} - - name: Create image pushed notice - run: 'echo "::notice title=Image has been pushed to ECR::Image tag: ${{ steps.get-app-version.outputs.app-version }}"' \ No newline at end of file + - name: Print tag info + run: | + prefix_message="Pushed new tag to ECR:" + echo -e "### 🏷️ $prefix_message \n\`\`\`\n${{ steps.get-app-version.outputs.app-version }}\n\`\`\`" >> $GITHUB_STEP_SUMMARY + echo -e "$prefix_message\n\e[1m${{ steps.get-app-version.outputs.app-version }}\e[0m" \ No newline at end of file From 164d5dc6b3eb4c1c893e3ec323ccd26ca7e5acec Mon Sep 17 00:00:00 2001 From: Callum Gare Date: Thu, 14 May 2026 15:02:00 +1000 Subject: [PATCH 3/5] chore: upgrade actions --- .github/workflows/build-docker-image.yaml | 2 +- .github/workflows/push-docker-image-to-ecr.yaml | 6 +++--- .github/workflows/run-in-docker-with-possible-artifact.yaml | 4 ++-- .github/workflows/run-in-docker.yaml | 2 +- actions/setup-docker-image/action.yaml | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-docker-image.yaml b/.github/workflows/build-docker-image.yaml index 36b188e..55f268a 100644 --- a/.github/workflows/build-docker-image.yaml +++ b/.github/workflows/build-docker-image.yaml @@ -21,7 +21,7 @@ jobs: app-version: ${{ steps.get-app-version.outputs.app-version }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Get app version id: get-app-version diff --git a/.github/workflows/push-docker-image-to-ecr.yaml b/.github/workflows/push-docker-image-to-ecr.yaml index d7f7580..6898da0 100644 --- a/.github/workflows/push-docker-image-to-ecr.yaml +++ b/.github/workflows/push-docker-image-to-ecr.yaml @@ -23,7 +23,7 @@ jobs: contents: read steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Get app version id: get-app-version @@ -43,7 +43,7 @@ jobs: APP_VERSION=${{ steps.get-app-version.outputs.app-version }} - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v6.1.0 with: aws-region: ap-southeast-2 role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/GithubActionsOIDC @@ -51,7 +51,7 @@ jobs: - name: Login to Amazon ECR id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 + uses: aws-actions/amazon-ecr-login@v2 with: mask-password: 'true' diff --git a/.github/workflows/run-in-docker-with-possible-artifact.yaml b/.github/workflows/run-in-docker-with-possible-artifact.yaml index f6782b4..3b43968 100644 --- a/.github/workflows/run-in-docker-with-possible-artifact.yaml +++ b/.github/workflows/run-in-docker-with-possible-artifact.yaml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Get app version id: get-app-version @@ -58,7 +58,7 @@ jobs: - name: Upload artifact if: ${{ always() }} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: Mocha maps - screenshots path: testing-screenshots diff --git a/.github/workflows/run-in-docker.yaml b/.github/workflows/run-in-docker.yaml index 594274b..70decbf 100644 --- a/.github/workflows/run-in-docker.yaml +++ b/.github/workflows/run-in-docker.yaml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Get app version id: get-app-version diff --git a/actions/setup-docker-image/action.yaml b/actions/setup-docker-image/action.yaml index a97a14a..ebcac43 100644 --- a/actions/setup-docker-image/action.yaml +++ b/actions/setup-docker-image/action.yaml @@ -9,7 +9,7 @@ inputs: load-image: description: 'Whether or not to load the image after creation' required: true - default: true + default: 'true' target: description: 'The build step target of the docker image' build-args: @@ -24,10 +24,10 @@ runs: using: "composite" steps: - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v4 - name: Build and export - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v7 with: context: . target: ${{ inputs.target }} From cd6885edc170fb98fbfcfe10526a01df804fbbb3 Mon Sep 17 00:00:00 2001 From: Callum Gare Date: Thu, 14 May 2026 16:56:52 +1000 Subject: [PATCH 4/5] fix: stop hardcoding actions commit ref --- .github/workflows/build-docker-image.yaml | 15 +++++++++++++-- .github/workflows/push-docker-image-to-ecr.yaml | 15 +++++++++++++-- .../run-in-docker-with-possible-artifact.yaml | 15 +++++++++++++-- .github/workflows/run-in-docker.yaml | 15 +++++++++++++-- 4 files changed, 52 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-docker-image.yaml b/.github/workflows/build-docker-image.yaml index 55f268a..8973c42 100644 --- a/.github/workflows/build-docker-image.yaml +++ b/.github/workflows/build-docker-image.yaml @@ -3,6 +3,10 @@ name: Build docker image to ensure all steps exist in the cache on: workflow_call: inputs: + workflow-ref: + description: 'The ref of infoxchange/github-ci to use for actions' + required: true + type: string image-target: type: string outputs: @@ -23,13 +27,20 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 + - name: Checkout github-ci actions + uses: actions/checkout@v6 + with: + repository: infoxchange/github-ci + ref: ${{ inputs.workflow-ref }} + path: .infoxchange-github-ci + - name: Get app version id: get-app-version - uses: infoxchange/github-ci/actions/get-app-version@main + uses: ./.infoxchange-github-ci/actions/get-app-version - name: Build docker image id: build-docker-image - uses: infoxchange/github-ci/actions/setup-docker-image@main + uses: ./.infoxchange-github-ci/actions/setup-docker-image with: load-image: false target: ${{ inputs.image-target }} diff --git a/.github/workflows/push-docker-image-to-ecr.yaml b/.github/workflows/push-docker-image-to-ecr.yaml index 6898da0..21780d7 100644 --- a/.github/workflows/push-docker-image-to-ecr.yaml +++ b/.github/workflows/push-docker-image-to-ecr.yaml @@ -3,6 +3,10 @@ name: Run command in docker container on: workflow_call: inputs: + workflow-ref: + description: 'The ref of infoxchange/github-ci to use for actions' + required: true + type: string image-target: description: 'The build step target of the docker image' type: string @@ -25,9 +29,16 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 + - name: Checkout github-ci actions + uses: actions/checkout@v6 + with: + repository: infoxchange/github-ci + ref: ${{ inputs.workflow-ref }} + path: .infoxchange-github-ci + - name: Get app version id: get-app-version - uses: infoxchange/github-ci/actions/get-app-version@main + uses: ./.infoxchange-github-ci/actions/get-app-version - name: Print info shell: bash @@ -36,7 +47,7 @@ jobs: - name: Load docker image id: load-docker-image - uses: infoxchange/github-ci/actions/setup-docker-image@main + uses: ./.infoxchange-github-ci/actions/setup-docker-image with: target: ${{ inputs.image-target }} build-args: | diff --git a/.github/workflows/run-in-docker-with-possible-artifact.yaml b/.github/workflows/run-in-docker-with-possible-artifact.yaml index 3b43968..6e7aab3 100644 --- a/.github/workflows/run-in-docker-with-possible-artifact.yaml +++ b/.github/workflows/run-in-docker-with-possible-artifact.yaml @@ -3,6 +3,10 @@ name: Run command in docker container and upload artifact if created on: workflow_call: inputs: + workflow-ref: + description: 'The ref of infoxchange/github-ci to use for actions' + required: true + type: string image-target: description: 'The build step target of the docker image' type: string @@ -31,13 +35,20 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 + - name: Checkout github-ci actions + uses: actions/checkout@v6 + with: + repository: infoxchange/github-ci + ref: ${{ inputs.workflow-ref }} + path: .infoxchange-github-ci + - name: Get app version id: get-app-version - uses: infoxchange/github-ci/actions/get-app-version@main + uses: ./.infoxchange-github-ci/actions/get-app-version - name: Setup docker image id: setup-docker-image - uses: infoxchange/github-ci/actions/setup-docker-image@main + uses: ./.infoxchange-github-ci/actions/setup-docker-image with: target: ${{ inputs.image-target }} build-args: | diff --git a/.github/workflows/run-in-docker.yaml b/.github/workflows/run-in-docker.yaml index 70decbf..27c70c1 100644 --- a/.github/workflows/run-in-docker.yaml +++ b/.github/workflows/run-in-docker.yaml @@ -3,6 +3,10 @@ name: Run command in docker container on: workflow_call: inputs: + workflow-ref: + description: 'The ref of infoxchange/github-ci to use for actions' + required: true + type: string image-target: description: 'The build step target of the docker image' type: string @@ -22,13 +26,20 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 + - name: Checkout github-ci actions + uses: actions/checkout@v6 + with: + repository: infoxchange/github-ci + ref: ${{ inputs.workflow-ref }} + path: .infoxchange-github-ci + - name: Get app version id: get-app-version - uses: infoxchange/github-ci/actions/get-app-version@main + uses: ./.infoxchange-github-ci/actions/get-app-version - name: Setup docker image id: setup-docker-image - uses: infoxchange/github-ci/actions/setup-docker-image@main + uses: ./.infoxchange-github-ci/actions/setup-docker-image with: target: ${{ inputs.image-target }} build-args: | From fad50c1ca562e7b5e9835f2c472e980f4ae20309 Mon Sep 17 00:00:00 2001 From: Callum Gare Date: Fri, 15 May 2026 13:08:43 +1000 Subject: [PATCH 5/5] fixup! feat: improve how tag info is displayed --- .github/workflows/push-docker-image-to-ecr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-docker-image-to-ecr.yaml b/.github/workflows/push-docker-image-to-ecr.yaml index 21780d7..d524039 100644 --- a/.github/workflows/push-docker-image-to-ecr.yaml +++ b/.github/workflows/push-docker-image-to-ecr.yaml @@ -40,10 +40,10 @@ jobs: id: get-app-version uses: ./.infoxchange-github-ci/actions/get-app-version - - name: Print info + - name: "ℹ️ Print info" shell: bash run: | - echo "Preparing to push tag: ${{ steps.get-app-version.outputs.app-version }}" + echo -e "Preparing to push tag: \e[1m${{ steps.get-app-version.outputs.app-version }}\e[0m" - name: Load docker image id: load-docker-image