Skip to content
Open
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions .github/workflows/check-problem-specs-is-current.yml
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions bin/check-problem-specs-is-current
Original file line number Diff line number Diff line change
@@ -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}."