mirror of
https://github.com/storytold/craft-common-actions.git
synced 2026-11-25 12:04:05 +01:00
The check accepts the old house-rules blocks or one craft-agents block (standards/app-agents.md, RFC-0072). write-agents writes or refreshes the block from a craft-contrib commit on main and keeps text outside it.
58 lines
1.9 KiB
YAML
58 lines
1.9 KiB
YAML
name: House rules
|
|
|
|
# Fails unless AGENTS.md copies the shared rules (the craft-agents block, or the old house-rules blocks) from craft-contrib unchanged, at a commit that is
|
|
# on main. An intact older copy warns only when its normalized standards file changed on main, and does not fail. Callers run it beside their gate:
|
|
#
|
|
# house-rules:
|
|
# uses: storytold/craft-common-actions/.github/workflows/house-rules.yml@main
|
|
# with:
|
|
# rust: true
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
working-directory:
|
|
description: "Directory that contains AGENTS.md, relative to the checkout"
|
|
type: string
|
|
required: false
|
|
default: "."
|
|
rust:
|
|
description: "Old house-rules blocks only: require the Rust block as well as the core block"
|
|
type: boolean
|
|
required: false
|
|
default: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
house-rules:
|
|
name: House rules match craft-contrib
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Harden runner
|
|
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
|
with:
|
|
egress-policy: block
|
|
allowed-endpoints: >
|
|
*.amazontrust.com:80
|
|
esm.ubuntu.com:443
|
|
motd.ubuntu.com:443
|
|
api.github.com:443
|
|
github.com:443
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
repository: storytold/craft-contrib
|
|
ref: main
|
|
path: .craft-contrib
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
- uses: storytold/craft-common-actions/actions/house-rules@main
|
|
with:
|
|
working-directory: ${{ inputs.working-directory }}
|
|
source: .craft-contrib
|
|
require-rust: ${{ inputs.rust }}
|