Skip to content
Merged
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
36 changes: 36 additions & 0 deletions .github/workflows/require-archived-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Require archived changes

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
check-archived:
name: Require archived changes
runs-on: ubuntu-latest

steps:
- name: Check out repository
# actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
fetch-depth: 0

- name: Check for unarchived OpenSpec changes
shell: bash
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
HEAD_SHA: ${{ github.sha }}
run: |
unarchived="$(git diff --name-only --diff-filter=d --no-renames "$BASE_SHA" "$HEAD_SHA" -- \
openspec/changes/ ':(exclude)openspec/changes/archive/')"
if [[ -n "$unarchived" ]]; then
echo "::error::Unarchived OpenSpec files changed. Apply and archive them in this PR before merging."
printf '%s\n' "$unarchived"
exit 1
fi
Loading