From 634ba615302b918b2e51e74e096861b26d113789 Mon Sep 17 00:00:00 2001 From: Jackson Hoffart Date: Tue, 29 Jul 2025 11:47:58 +0200 Subject: [PATCH 1/2] ci: gains action to validate contents of `latest` against most recent timestamped directory --- .github/workflows/validate_latest.yml | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/validate_latest.yml diff --git a/.github/workflows/validate_latest.yml b/.github/workflows/validate_latest.yml new file mode 100644 index 0000000..a1e147f --- /dev/null +++ b/.github/workflows/validate_latest.yml @@ -0,0 +1,31 @@ +name: Validate latest release + +on: + push: + branches: + - main + paths: + - 'releases/**' + pull_request: + branches: + - main + paths: + - 'releases/**' + +jobs: + validate-latest-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Identify highest version releases directory + id: find-version + run: | + latest_version=$(ls releases/ | grep -E '^[0-9]{4}-[0-9]{2}-[0-9]{2}$' | sort | tail -n1) + echo "latest_version=$latest_version" >> "$GITHUB_OUTPUT" + echo "Latest version directory: $latest_version" + + - name: Compare latest to highest version + run: | + diff_output=$(diff -r releases/latest releases/${{ steps.find-version.outputs.latest_version }}) || (echo "$diff_output"; exit 1) + echo "✅ 'latest' releases matches highest version: ${{ steps.find-version.outputs.latest_version }}" From 4f34819313c2de825301f3f06af0678c0d9e641c Mon Sep 17 00:00:00 2001 From: Jackson Hoffart Date: Tue, 29 Jul 2025 11:51:51 +0200 Subject: [PATCH 2/2] trigger workflow if it is edited --- .github/workflows/validate_latest.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/validate_latest.yml b/.github/workflows/validate_latest.yml index a1e147f..4b948df 100644 --- a/.github/workflows/validate_latest.yml +++ b/.github/workflows/validate_latest.yml @@ -6,11 +6,14 @@ on: - main paths: - 'releases/**' + - '.github/workflows/validate_latest.yml' pull_request: branches: - main paths: - 'releases/**' + - '.github/workflows/validate_latest.yml' + jobs: validate-latest-release: