panic when image does not exist, warnings/errors have been emitted and running on CI or with CROSS_NO_WARNINGS=1
#2914
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
types: [labeled, unlabeled, opened, synchronize, reopened] | |
name: Changelog check | |
jobs: | |
changelog: | |
name: Changelog check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/setup-rust | |
- name: Get Changed Files | |
id: files | |
uses: tj-actions/changed-files@v41 | |
with: | |
separator: ';' | |
files: | | |
.changes/*.json | |
- name: Validate Changelog Files | |
id: changelog | |
run: | | |
set -x | |
set -e | |
IFS=';' read -a added_modified <<< '${{ steps.files.outputs.all_changed_files }}' | |
IFS=';' read -a removed <<< '${{ steps.files.outputs.deleted_files }}' | |
added_count=${#added_modified[@]} | |
removed_count=${#removed[@]} | |
if ${{ !contains(github.event.pull_request.labels.*.name, 'no changelog' ) }}; then | |
if [[ "$added_count" -eq "0" ]] && [[ "$removed_count" -eq "0" ]]; then | |
echo "Must add or remove changes or add the 'no changelog' label" | |
exit 1 | |
else | |
basenames=() | |
for path in "${added_modified[@]}"; do | |
basenames+=($(basename "${path}")) | |
done | |
cargo xtask changelog validate "${basenames[@]}" | |
fi | |
fi |