diff --git a/.github/workflows/update-docker-args.yml b/.github/workflows/update-docker-args.yml index d4f9a10..b09a7a2 100644 --- a/.github/workflows/update-docker-args.yml +++ b/.github/workflows/update-docker-args.yml @@ -13,13 +13,18 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Google Auth + uses: google-github-actions/auth@v2 + with: + credentials_json: '${{ secrets.HELM_GCS_CREDENTIALS }}' + - name: Update Docker Args shell: bash id: args run: | BASE_IMAGE="gcr.io/distroless/cc-debian12" BASE_IMAGE_TAG="debug" - BASE_IMAGE_DIGEST=$(gcloud container images list-tags $BASE_IMAGE --format json | jq --arg tag "$BASE_IMAGE_TAG" -r '.[] | {digest: .digest, tag: .tags[]} | select(.tag == $tag) | .digest') + BASE_IMAGE_DIGEST=$(gcloud container images list-tags $BASE_IMAGE --filter="tags=$BASE_IMAGE_TAG" --format json | jq --arg tag "$BASE_IMAGE_TAG" -r '.[] | {digest: .digest, tag: .tags[]} | select(.tag == $tag) | .digest') if [ -n "$BASE_IMAGE_DIGEST" ]; then echo -n "${BASE_IMAGE}:${BASE_IMAGE_TAG}@${BASE_IMAGE_DIGEST}" > java-11/base.image echo -n "${BASE_IMAGE}:${BASE_IMAGE_TAG}@${BASE_IMAGE_DIGEST}" > java-21/base.image @@ -35,6 +40,9 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} title: Update docker args (Automated) + add-paths: | + java-11/base.image + java-21/base.image body: | # Autogenerated docker args update: digest: ${{ steps.args.outputs.digest }} @@ -43,7 +51,7 @@ jobs: branch-suffix: timestamp - name: Enable Pull Request Automerge - if: steps.args.outputs.digest != 'null' + if: steps.create-pull-request.outputs.pull-request-number != '' uses: peter-evans/enable-pull-request-automerge@v3 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -51,7 +59,7 @@ jobs: merge-method: squash # - name: Approve Pull Request - # if: steps.args.outputs.digest != 'null' + # if: steps.create-pull-request.outputs.pull-request-number != '' # uses: juliangruber/approve-pull-request-action@v2 # with: # github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 1f93dfc..574a11a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ build .idea + +# Ignore google credential files created by Github Actions +gha-creds-*.json