Skip to content

Commit

Permalink
Add comment(s) on PR with command(s) for running image(s) built for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
TimHess committed Feb 24, 2025
1 parent afc839a commit 9ef4743
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build_config_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ concurrency:

permissions:
contents: read
pull-requests: 'write'

env:
IMAGE_NAME: config-server
Expand Down Expand Up @@ -47,3 +48,17 @@ jobs:

- name: Push image
run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- uses: actions/github-script@v7
if: ${{ github.event_name == 'pull_request' }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `To run the Spring Cloud Config Server image built for this pull request:
\`\`\`bash
docker run --rm -d --pull=always -p 8888:8888 --name config-pr steeltoe.azurecr.io/config-server:pr-${{ github.event.number }}
\`\`\``
})
15 changes: 15 additions & 0 deletions .github/workflows/build_eureka_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ concurrency:

permissions:
contents: read
pull-requests: 'write'

env:
IMAGE_NAME: eureka-server
Expand Down Expand Up @@ -47,3 +48,17 @@ jobs:

- name: Push image
run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- uses: actions/github-script@v7
if: ${{ github.event_name == 'pull_request' }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `To run the Eureka server image built for this pull request:
\`\`\`bash
docker run --rm -d --pull=always -p 8761:8761 --name eureka-pr steeltoe.azurecr.io/eureka-server:pr-${{ github.event.number }}
\`\`\``
})
15 changes: 15 additions & 0 deletions .github/workflows/build_springboot_admin_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ concurrency:

permissions:
contents: read
pull-requests: 'write'

env:
IMAGE_NAME: spring-boot-admin
Expand Down Expand Up @@ -47,3 +48,17 @@ jobs:

- name: Push image
run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- uses: actions/github-script@v7
if: ${{ github.event_name == 'pull_request' }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `To run the Spring Boot Admin server image built for this pull request:
\`\`\`bash
docker run --rm -d --pull=always -p 9099:9099 --name sba-pr steeltoe.azurecr.io/spring-boot-admin:pr-${{ github.event.number }}
\`\`\``
})
15 changes: 15 additions & 0 deletions .github/workflows/build_uaa_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ concurrency:

permissions:
contents: read
pull-requests: 'write'

env:
IMAGE_NAME: uaa-server
Expand Down Expand Up @@ -47,3 +48,17 @@ jobs:

- name: Push image
run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- uses: actions/github-script@v7
if: ${{ github.event_name == 'pull_request' }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `To run the UAA server image built for this pull request:
\`\`\`bash
docker run --rm -d --pull=always -p 8080:8080 --name uaa-pr steeltoe.azurecr.io/uaa-server:pr-${{ github.event.number }}
\`\`\``
})

0 comments on commit 9ef4743

Please sign in to comment.