diff --git a/.github/workflows/image-deps-updater.yaml b/.github/workflows/image-deps-updater.yaml index 2449f362d..dc1b8bd18 100644 --- a/.github/workflows/image-deps-updater.yaml +++ b/.github/workflows/image-deps-updater.yaml @@ -119,32 +119,34 @@ jobs: components=${{ toJson(needs.get-versions.outputs.components) }} for component in $(echo "${components}" | jq -c '.[]'); do + name=$(echo "$component" | jq -r '.name') version=$(echo "$component" | jq -r '.version') + digest=$(docker manifest inspect ttl.sh/ec/$name:$version | jq -r '.manifests[0].digest') makefile_var=$(echo "$component" | jq -r '.makefile_var') - sed -i "s/^$makefile_var.*/$makefile_var = $version/" Makefile + sed -i "s/^$makefile_var.*/$makefile_var = $version@$digest/" Makefile done - # - name: Create Pull Request # creates a PR if there are differences - # uses: peter-evans/create-pull-request@v6 - # id: cpr - # with: - # token: ${{ secrets.AUTOMATED_PR_GH_PAT }} - # commit-message: 'Update image versions' - # title: 'Automated image updates' - # branch: automation/image-dependencies - # delete-branch: true - # labels: | - # automated-pr - # images - # type::security - # # draft: false - # draft: true - # # base: "main" - # base: "sgalsaleh/sc-108755/use-chainguard-images-for-embedded-cluster" - # body: "Automated changes by the [image-deps-updater](https://github.com/replicatedhq/embedded-cluster/blob/main/.github/workflows/image-deps-updater.yaml) GitHub action" - - # - name: Check outputs - # if: ${{ steps.cpr.outputs.pull-request-number }} - # run: | - # echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - # echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" \ No newline at end of file + - name: Create Pull Request # creates a PR if there are differences + uses: peter-evans/create-pull-request@v6 + id: cpr + with: + token: ${{ secrets.AUTOMATED_PR_GH_PAT }} + commit-message: 'Update image versions' + title: 'Automated image updates' + branch: automation/image-dependencies + delete-branch: true + labels: | + automated-pr + images + type::security + # draft: false + draft: true + # base: "main" + base: "sgalsaleh/sc-108755/use-chainguard-images-for-embedded-cluster" + body: "Automated changes by the [image-deps-updater](https://github.com/replicatedhq/embedded-cluster/blob/main/.github/workflows/image-deps-updater.yaml) GitHub action" + + - name: Check outputs + if: ${{ steps.cpr.outputs.pull-request-number }} + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"