Skip to content

multiline body

multiline body #52

name: Build Config Server
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/build_config_server.yaml'
- 'config-server/**'
push:
branches:
- main
paths:
- '.github/workflows/build_config_server.yaml'
- 'config-server/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: 'write'
env:
IMAGE_NAME: config-server
REGISTRY: ${{ vars.DOCKER_REGISTRY }}
jobs:
build-push:
name: Build and push image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# - name: Build Image
# run: ./build.ps1 -Name '${{ env.IMAGE_NAME }}' -Registry '${{ env.REGISTRY }}' -Tag '${{ env.TAG }}'
# shell: pwsh
# env:
# TAG: ${{ github.event_name == 'pull_request' && format('-t {0}/{1}:pr-{2}', env.REGISTRY, env.IMAGE_NAME, github.event.number) || '' }}
# - name: Login to container registry
# uses: docker/login-action@v3
# with:
# registry: ${{ vars.DOCKER_REGISTRY }}
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Push image
# run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Post PR comment with image info
if: ${{ github.event_name == 'pull_request' }}
run: gh pr comment $PR_NUMBER --edit-last --create-if-none --body "To run the Spring Cloud Config Server image built for this pull request:

Check failure on line 54 in .github/workflows/build_config_server.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/build_config_server.yaml

Invalid workflow file

You have an error in your yaml syntax on line 54
\`\`\`bash
docker run --rm -d --pull=always -p 8888:8888 --name config-pr $REGISTRY/$IMAGE_NAME:pr-$PR_NUMBER
\`\`\`"
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}