Skip to content

Commit 4edc8f0

Browse files
committed
eureka-server: don't create a new PR comment if it already exists
1 parent ab03048 commit 4edc8f0

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

.github/workflows/build_eureka_server.yaml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,14 @@ jobs:
4949
- name: Push image
5050
run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
5151

52-
- uses: actions/github-script@v7
52+
- name: Post PR comment with image info
5353
if: ${{ github.event_name == 'pull_request' }}
54-
with:
55-
script: |
56-
github.rest.issues.createComment({
57-
issue_number: context.issue.number,
58-
owner: context.repo.owner,
59-
repo: context.repo.repo,
60-
body: `To run the Eureka server image built for this pull request:
61-
\`\`\`bash
62-
docker run --rm -d --pull=always -p 8761:8761 --name eureka-pr steeltoe.azurecr.io/eureka-server:pr-${{ github.event.number }}
63-
\`\`\``
64-
})
54+
run: |
55+
gh pr comment $PR_NUMBER --edit-last --create-if-none --body "To run the Eureka Server image built for this pull request:
56+
\`\`\`bash
57+
docker run --rm -d --pull=always -p 8761:8761 --name eureka-pr steeltoe.azurecr.io/eureka-server:pr-$PR_NUMBER
58+
\`\`\`"
59+
shell: bash
60+
env:
61+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
PR_NUMBER: ${{ github.event.number }}

0 commit comments

Comments
 (0)