Skip to content

Commit 270ac15

Browse files
committed
Don't create a new PR comment if it already exists
1 parent b5407a0 commit 270ac15

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ indent_size = 4
1010
trim_trailing_whitespace = true
1111
insert_final_newline = true
1212
charset = utf-8
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
16+
tab-width = 2
17+
max_line_length = 160
18+
indent_size = 2

.github/workflows/build_config_server.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,15 @@ 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 Spring Cloud Config Server image built for this pull request:
54+
run: |
55+
gh pr comment $PR_NUMBER --edit-last --create-if-none `
56+
--body `To run the Spring Cloud Config Server image built for this pull request:
6157
\`\`\`bash
62-
docker run --rm -d --pull=always -p 8888:8888 --name config-pr steeltoe.azurecr.io/config-server:pr-${{ github.event.number }}
58+
docker run --rm -d --pull=always -p 8888:8888 --name config-pr $REGISTRY/$IMAGE_NAME:pr-$PR_NUMBER
6359
\`\`\``
64-
})
60+
shell: bash
61+
env:
62+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
PR_NUMBER: ${{ github.event.number }}

0 commit comments

Comments
 (0)