diff --git a/.github/workflows/check-problem-specs-is-current.yml b/.github/workflows/check-problem-specs-is-current.yml new file mode 100644 index 0000000..f9a8870 --- /dev/null +++ b/.github/workflows/check-problem-specs-is-current.yml @@ -0,0 +1,21 @@ +name: Check Problem Specifications is Current + +on: + pull_request: + types: [opened, reopened, synchronize, ready_for_review] + workflow_dispatch: + +permissions: + contents: read + +jobs: + check_problem_specifications: + name: Check problem specifications + runs-on: ubuntu-24.04 + + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + + - name: Check problem-specifications is current + run: bin/check-problem-specs-is-current diff --git a/bin/check-problem-specs-is-current b/bin/check-problem-specs-is-current new file mode 100755 index 0000000..a0ecb4d --- /dev/null +++ b/bin/check-problem-specs-is-current @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Synopsis: +# Verify that the problem-specifications submodule is up-to-date with the latest upstream commit. + +set -euo pipefail + +latest_commit="$(git ls-remote https://github.com/exercism/problem-specifications.git refs/heads/main | cut -f1)" + +if [[ -z "$latest_commit" ]]; then + echo "::error:: Could not determine latest upstream problem-specifications commit." + exit 1 +fi + +current_commit="$(git rev-parse HEAD:problem-specifications)" + +if [[ "$current_commit" != "$latest_commit" ]]; then + echo "::error:: The problem-specifications submodule is out of date. Update it to ${latest_commit}." + exit 1 +fi + +echo "The problem-specifications submodule is current at ${current_commit}." diff --git a/problem-specifications b/problem-specifications index 0ebef3c..99a6f01 160000 --- a/problem-specifications +++ b/problem-specifications @@ -1 +1 @@ -Subproject commit 0ebef3c03248e718b261815dc703c1a1600630f0 +Subproject commit 99a6f01317bb993124cbe8bf8027a1cfdf2dc537