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

fix(ci): code freeze action fix #1610

Merged
merged 5 commits into from
Oct 1, 2024
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
12 changes: 6 additions & 6 deletions .github/workflows/code-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,35 @@ jobs:
list-files: shell
filters: .github/code-freeze-filter.yaml
- name: Output Failure
if: steps.filters.outputs.changes != '' && !contains(github.event.pull_request.labels.*.name, 'override-freeze')
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/,changed//g' | sed 's/,/, /g' | sed 's/[][]//g')
echo "### ${TITLE}" >> $GITHUB_STEP_SUMMARY
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
IFS="," read -ra FILE_LIST <<< "${{ steps.filters.outputs.changed_files }}"
FILES="${{ steps.filters.outputs.changed_files }}"
FILE_MESSAGE="This file is under code freeze."
for FILE in "${FILE_LIST[@]}"; do
for FILE in $FILES; do
echo " - ${FILE}" >> $GITHUB_STEP_SUMMARY
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
exit 1
- name: Output Bypass
if: steps.filters.outputs.changes != '' && !contains(github.event.pull_request.labels.*.name, 'override-freeze')
if: steps.filters.outputs.changes != '[]' && contains(github.event.pull_request.labels.*.name, 'override-freeze')
run: |
TITLE="Code Freeze in Effect - Bypassed"
LEGIBLE_CHANGES=$(echo "${{ steps.filters.outputs.changes }}" | sed 's/,changed//g' | sed 's/,/, /g' | sed 's/[][]//g')
echo "### ${TITLE}" >> $GITHUB_STEP_SUMMARY
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
IFS="," read -ra FILE_LIST <<< "${{ steps.filters.outputs.changed_files }}"
FILES="${{ steps.filters.outputs.changed_files }}"
FILE_MESSAGE="This file is under code freeze."
for FILE in "${FILE_LIST[@]}"; do
for FILE in $FILES; do
echo " - ${FILE}" >> $GITHUB_STEP_SUMMARY
echo "::warning file=$FILE,title=$TITLE::$FILE_MESSAGE"
done
Expand Down
Loading