From e19df88189724ffc3e5fb4cc6f346dd4e7ad4bed Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Mon, 17 Apr 2023 21:03:30 -0400 Subject: [PATCH 1/2] Add PR comment with pushed image info --- .github/workflows/docker-mod-builder.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/docker-mod-builder.yml b/.github/workflows/docker-mod-builder.yml index 489fbf1..861b4f2 100644 --- a/.github/workflows/docker-mod-builder.yml +++ b/.github/workflows/docker-mod-builder.yml @@ -123,6 +123,15 @@ jobs: echo "Pushed the following PR image/tag to GHCR:" >> $GITHUB_STEP_SUMMARY echo "ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY + - name: Add GHCR push comment to PR + uses: peter-evans/create-or-update-comment@v3.0.0 + if: ${{ env.GITHUB_REPO == format('{0}/{1}', github.event.pull_request.base.repo.owner.login, github.event.pull_request.base.repo.name) && env.CR_USER && env.CR_PAT }} + with: + token: ${{ secrets.CR_PAT }} + issue-number: ${{ github.event.pull_request.number }} + body: | + PR build pushed to `ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }}` + - name: Login to DockerHub if: ${{ (github.event_name == 'push' && github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) && env.GITHUB_REPO == github.repository || env.GITHUB_REPO == format('{0}/{1}', github.event.pull_request.base.repo.owner.login, github.event.pull_request.base.repo.name)) && env.DOCKERUSER && env.DOCKERPASS }} run: | From 5a1fc764c56b1c5c7f9db01dca7a4a1607760831 Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Tue, 18 Apr 2023 09:17:57 -0400 Subject: [PATCH 2/2] use github var --- .github/workflows/docker-mod-builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-mod-builder.yml b/.github/workflows/docker-mod-builder.yml index 861b4f2..eae0f0e 100644 --- a/.github/workflows/docker-mod-builder.yml +++ b/.github/workflows/docker-mod-builder.yml @@ -130,7 +130,7 @@ jobs: token: ${{ secrets.CR_PAT }} issue-number: ${{ github.event.pull_request.number }} body: | - PR build pushed to `ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }}` + PR build pushed to `ghcr.io/${{ inputs.ENDPOINT }}:pull_request_${{ github.event.pull_request.number }}` - name: Login to DockerHub if: ${{ (github.event_name == 'push' && github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) && env.GITHUB_REPO == github.repository || env.GITHUB_REPO == format('{0}/{1}', github.event.pull_request.base.repo.owner.login, github.event.pull_request.base.repo.name)) && env.DOCKERUSER && env.DOCKERPASS }}