Skip to content

Commit 9ef4743

Browse files
committed
Add comment(s) on PR with command(s) for running image(s) built for PR
1 parent afc839a commit 9ef4743

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

.github/workflows/build_config_server.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ concurrency:
2020

2121
permissions:
2222
contents: read
23+
pull-requests: 'write'
2324

2425
env:
2526
IMAGE_NAME: config-server
@@ -47,3 +48,17 @@ jobs:
4748

4849
- name: Push image
4950
run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
51+
52+
- uses: actions/github-script@v7
53+
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:
61+
\`\`\`bash
62+
docker run --rm -d --pull=always -p 8888:8888 --name config-pr steeltoe.azurecr.io/config-server:pr-${{ github.event.number }}
63+
\`\`\``
64+
})

.github/workflows/build_eureka_server.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ concurrency:
2020

2121
permissions:
2222
contents: read
23+
pull-requests: 'write'
2324

2425
env:
2526
IMAGE_NAME: eureka-server
@@ -47,3 +48,17 @@ jobs:
4748

4849
- name: Push image
4950
run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
51+
52+
- uses: actions/github-script@v7
53+
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+
})

.github/workflows/build_springboot_admin_server.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ concurrency:
2020

2121
permissions:
2222
contents: read
23+
pull-requests: 'write'
2324

2425
env:
2526
IMAGE_NAME: spring-boot-admin
@@ -47,3 +48,17 @@ jobs:
4748

4849
- name: Push image
4950
run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
51+
52+
- uses: actions/github-script@v7
53+
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 Boot Admin server image built for this pull request:
61+
\`\`\`bash
62+
docker run --rm -d --pull=always -p 9099:9099 --name sba-pr steeltoe.azurecr.io/spring-boot-admin:pr-${{ github.event.number }}
63+
\`\`\``
64+
})

.github/workflows/build_uaa_server.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ concurrency:
2020

2121
permissions:
2222
contents: read
23+
pull-requests: 'write'
2324

2425
env:
2526
IMAGE_NAME: uaa-server
@@ -47,3 +48,17 @@ jobs:
4748

4849
- name: Push image
4950
run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
51+
52+
- uses: actions/github-script@v7
53+
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 UAA server image built for this pull request:
61+
\`\`\`bash
62+
docker run --rm -d --pull=always -p 8080:8080 --name uaa-pr steeltoe.azurecr.io/uaa-server:pr-${{ github.event.number }}
63+
\`\`\``
64+
})

0 commit comments

Comments
 (0)