Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the PR comment accessible to the metrics step #290

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ jobs:
report_content: ${{ steps.check_report.outputs.report_content }}
redhat_to_community: ${{ steps.check_report.outputs.redhat_to_community }}
message_file: ${{ steps.pr_comment.outputs.message-file }}
message_text_base64: ${{ steps.encode_pr_comment.outputs.message-text-base64 }}
web_catalog_only: ${{ steps.check_pr_content.outputs.web_catalog_only }}
chart_entry_name: ${{ steps.check_pr_content.outputs.chart-entry-name }}
release_tag: ${{ steps.check_pr_content.outputs.release_tag }}
Expand Down Expand Up @@ -340,6 +341,15 @@ jobs:
run: |
ve1/bin/pr-comment ${{ steps.check_pr_content.outcome }} ${{ steps.run-verifier.outcome }} ${{ steps.check_report.conclusion }}

# Note(komish): This step is a temporary fix for the metrics step in the next job
# which expects the PR comment to exist at the specified filesystem location.
- name: Encode PR Comment for Metrics
id: encode_pr_comment
if: ${{ always() && needs.setup.outputs.run_build == 'true' }}
run: |
commentBase64=$(base64 --wrap=0 ${{ steps.pr_comment.outputs.message-file }})
echo "message-text-base64=${commentBase64}" | tee -a $GITHUB_OUTPUT

- name: Comment on PR
if: ${{ always() && needs.setup.outputs.run_build == 'true' }}
uses: actions/github-script@v6
Expand Down Expand Up @@ -489,6 +499,16 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Note(komish): This step is a temporary workaround. Metrics requires the PR comment
# to be available, but it is written to the filesystem in the previous job.
# This can be removed once the metrics execution is restructured to have access to the PR
# comment, or pulled out of the release job entirely.
- name: Retrieve PR comment for metrics
if: ${{ always() && needs.setup.outputs.run_build == 'true' && env.GITHUB_REPOSITORY != 'openshift-helm-charts/sandbox' }}
run: |
mkdir -p $(dirname ${{ needs.chart-verifier.outputs.message_file }})
echo ${{ needs.chart-verifier.outputs.message_text_base64 }} | base64 -d | tee ${{ needs.chart-verifier.outputs.message_file }}

- name: Add metrics
if: ${{ always() && needs.setup.outputs.run_build == 'true' && env.GITHUB_REPOSITORY != 'openshift-helm-charts/sandbox' }}
env:
Expand Down
Loading