From 54e2cd837f88f5d37a388aed38361f593be37703 Mon Sep 17 00:00:00 2001 From: Jordan Oroshiba Date: Fri, 27 Sep 2024 11:40:00 -0700 Subject: [PATCH] better? --- .github/workflows/code-freeze.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/code-freeze.yml b/.github/workflows/code-freeze.yml index aaab86420d..111a5a0242 100644 --- a/.github/workflows/code-freeze.yml +++ b/.github/workflows/code-freeze.yml @@ -24,22 +24,20 @@ jobs: if: steps.filters.outputs.changes != '' && !contains(github.event.pull_request.labels.*.name, 'override-freeze') run: | TITLE="Code Freeze in Effect" - LEGIBLE_CHANGES=$(echo "${{ steps.filters.outputs.changes }}" sed 's/,/, /g') - MESSAGE=("This PR updates the following components which are code frozen:" - "$LEGIBLE_CHANGES" - "Freeze can be overriden by adding the 'override-freeze' label to the PR." - ) + SUMMARY_MESSAGE_BODY="" + LEGIBLE_CHANGES=$(echo "${{ steps.filters.outputs.changes }}" | sed 's/,changed//g' | sed 's/,/, /g' | sed 's/[][]//g') echo "### ${TITLE}" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_ENV - echo "This PR updates the following components which are code frozen: ${LEGIBLE_CHANGES}" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "The following files are modified and frozen:" >> $GITHUB_STEP_SUMMARY + echo "This PR updates the following components which are code frozen: ${LEGIBLE_CHANGES}" >> $SUMMARY_MESSAGE_BODY + echo "" >> $SUMMARY_MESSAGE_BODY + echo "The following files are modified and frozen:" >> $SUMMARY_MESSAGE_BODY IFS="," read -ra FILE_LIST <<< "${{ steps.filters.outputs.changed_files }}" FILE_MESSAGE="This file is under code freeze." for FILE in "${FILE_LIST[@]}"; do - echo " - ${FILE}" >> $GITHUB_STEP_SUMMARY + echo " - ${FILE}" >> $SUMMARY_MESSAGE_BODY echo "::error file=$FILE,title=$TITLE::$FILE_MESSAGE" done echo "" >> $GITHUB_STEP_SUMMARY - echo "Freeze can be overriden by adding the 'override-freeze' label to the PR." >> $GITHUB_STEP_SUMMARY + echo "Freeze can be overriden by adding the 'override-freeze' label to the PR." >> $SUMMARY_MESSAGE_BODY + echo "::error title=$TITLE::$SUMMARY_MESSAGE_BODY" exit 1