Skip to content

Commit 823f0a4

Browse files
authored
Merge pull request #77 from GeoscienceAustralia/upgrade/auto-docker-version
fix file change and notify user making release it needs to be approved
2 parents 5773632 + 81f615e commit 823f0a4

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/push-image-to-ecr.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,22 @@ jobs:
2222

2323
- name: Update Dockerfile version label
2424
run: |
25-
sed -i "s/^ARG VERSION=.*/ARG VERSION=${VERSION}/" Docker/Dockerfile
26-
echo "Updated Dockerfile version to ${VERSION}"
25+
sed -i "s/^ARG VERSION=.*/ARG VERSION=${{ env.VERSION }}/" Docker/Dockerfile
26+
echo "Updated Dockerfile version to ${{ env.VERSION }}"
27+
28+
- name: Confirm updated Dockerfile version
29+
run: grep "ARG VERSION=" Docker/Dockerfile
2730

2831
- name: Commit and push Dockerfile version update via PR
29-
env:
30-
VERSION: ${{ env.VERSION }}
3132
run: |
3233
git config user.name "github-actions"
3334
git config user.email "github-actions@github.com"
3435
35-
BRANCH="update-dockerfile-version-${VERSION}"
36+
BRANCH="update-dockerfile-version-${{ env.VERSION }}"
3637
git checkout -b $BRANCH
3738
3839
git add Docker/Dockerfile
39-
git commit -m "Update Dockerfile version to ${VERSION} from release"
40+
git commit -m "Update Dockerfile version to ${{ env.VERSION }} from release"
4041
git push origin $BRANCH
4142
4243
echo "branch_name=$BRANCH" >> $GITHUB_OUTPUT
@@ -51,13 +52,15 @@ jobs:
5152
title: "Update Dockerfile version to ${{ env.VERSION }}"
5253
body: "Automated PR to update Dockerfile version to match release ${{ env.VERSION }}"
5354
base: main
55+
reviewers: ${{ github.event.release.author.login }}
5456

5557
- name: Enable auto-merge
5658
uses: peter-evans/enable-pull-request-automerge@v3
5759
with:
5860
token: ${{ secrets.GITHUB_TOKEN }}
5961
pull-request-number: ${{ steps.create_pr.outputs.pull-request-number }}
6062
merge-method: squash
63+
merge-when-succeeded: true
6164

6265
- name: Configure AWS credentials
6366
uses: aws-actions/configure-aws-credentials@v1

0 commit comments

Comments
 (0)