From 5fbf13bd2b906055a6857aa77349288c07c5096e Mon Sep 17 00:00:00 2001 From: Mike Watling Date: Thu, 29 Aug 2024 10:38:43 +0100 Subject: [PATCH] Removes unnecessary checks enforced on images used in changelogs. This attempts to solve a problem that simply does not exist and becomes a blocker for timely updates of changelog content. --- .../workflows/validate-changelog-assets.yaml | 25 --------- docs/changelog-assets/README.md | 6 +-- scripts/changelog-prepare-assets.sh | 53 ------------------- 3 files changed, 3 insertions(+), 81 deletions(-) delete mode 100644 .github/workflows/validate-changelog-assets.yaml delete mode 100755 scripts/changelog-prepare-assets.sh diff --git a/.github/workflows/validate-changelog-assets.yaml b/.github/workflows/validate-changelog-assets.yaml deleted file mode 100644 index ab19a6420c..0000000000 --- a/.github/workflows/validate-changelog-assets.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: Validate Changelog Assets - -on: - push: - branches: [ main ] - paths: - - "docs/changelog-assets/**" - - ".github/workflows/validate-changelog-assets.yaml" - pull_request: - branches: [ main ] - paths: - - "docs/changelog-assets/**" - - ".github/workflows/validate-changelog-assets.yaml" - workflow_dispatch: - -jobs: - validate: - runs-on: "ubuntu-latest" - - steps: - - uses: actions/checkout@v3 - - - name: Validate - shell: bash - run: ./scripts/changelog-prepare-assets.sh verify diff --git a/docs/changelog-assets/README.md b/docs/changelog-assets/README.md index 3c1b2d51f0..d5a4386635 100644 --- a/docs/changelog-assets/README.md +++ b/docs/changelog-assets/README.md @@ -4,7 +4,7 @@ This directory contains all assets used in the [CHANGELOG](https://github.com/Ne ## Adding Assets -### Naming + ### Images @@ -38,7 +38,7 @@ b2sum --length=128 filename - With color profile - No thumbnail -You can use any image manipulation program for this, like GIMP. Otherwise, if the image has already been cropped and you want to convert it to a WebP, use ffmpeg: +You can use any image manipulation program for this, like [GIMP](https://www.gimp.org/). Otherwise, if the image has already been cropped and you want to convert it to a WebP, use [ffmpeg](https://www.ffmpeg.org/): ```bash ffmpeg -i input.png -pix_fmt yuv420p -c:v libwebp -quality 80 -compression_level 6 output.webp diff --git a/scripts/changelog-prepare-assets.sh b/scripts/changelog-prepare-assets.sh deleted file mode 100755 index bf07faaaa2..0000000000 --- a/scripts/changelog-prepare-assets.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash - -current_dir="$(dirname -- "$(readlink -f -- "$0";)";)" -assets_dir="$(dirname "$current_dir")/docs/changelog-assets" - -echo "assets dir: $assets_dir" - -only_verify=0 -failed_validation=0 - -if [[ "$1" == "verify" ]]; then - echo "starting in validation mode" - only_verify=1 -fi - -FILES="$assets_dir/*" - -# checksums -for file in $FILES; do - filename=$(basename -- "$file") - if [[ "$filename" == "README.md" ]]; then - continue - fi - - extension="${filename##*.}" - filename="${filename%.*}" - - echo "$file: hashing" - filehash=$(b2sum --length=128 "$file" | awk '{print $1}') - - if [[ "$filename" == "$filehash" ]]; then - echo "$file: valid" - continue - fi - - echo "$file: FAILED" - if [[ $only_verify -eq 1 ]]; then - failed_validation=1 - continue - fi - - fixed_file="$(dirname "$file")/$filehash.$extension" - echo "$file: moving to $fixed_file" - - mv "$file" "$fixed_file" -done - -if [[ $failed_validation -eq 1 ]]; then - echo "validation failed!" - exit 1 -else - echo "validation was successful" -fi