Hi,
I have a use-case where I need to post the coverage-report as a Github comment on the PR.
I am using a GITHUB_COMMENT
env var and assigning it a placeholder value which would later be modified to be the code-coverage report value.
There seems to be a value mismatch in the Buildkite Step for the env var.
Echo value of GITHUB_COMMENT =
### CODE COVERAGE FOR NEST
total: (statements) 81.5%
Value in env command = "Template comment"
Can someone pls look into this ?
Why is the export command not able to modify the value of the var.
Link to build → https://buildkite.com/equinix/ngo-engineering/builds/1153#_
Thanks in advance.
env:
GITHUB_COMMENT: "Template comment"
- label: ":shrek: Report coverage comment on PR"
key: "report-coverage-comment-on-pr"
depends_on: ["retreive-code-coverage-artifacts"]
commands: |
#!/usr/bin/env bash
set -euo pipefail
echo --- Retrieve artifacts
buildkite-agent artifact download "code_coverage_summary.md" .
export GITHUB_COMMENT=$(cat code_coverage_summary.md)
echo "\$GITHUB_COMMENT"
echo "Token equals: $${GITHUB_TOKEN}"
plugins:
- ssh://git@github.com/packethost/ssm-buildkite-plugin#v1.0.4:
parameters:
GITHUB_TOKEN: /buildkite/ngo/GITHUB_PAT/v3
- telefonica/github-pr-comment#0.0.5:
comment: ${GITHUB_COMMENT}
pr: ${BUILDKITE_PULL_REQUEST} # Optional, PR Number to add the comment
repo: ${BUILDKITE_PULL_REQUEST_REPO} # Optional, format git://github.com:user/repo.git)```