Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug report
description: Something behaves differently from how it should
labels: ["bug"]
labels: ["type:bug", "needs-triage"]
body:
- type: markdown
attributes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature request
description: Propose something the product should do
labels: ["enhancement"]
name: Story (feature request)
description: Something a user should be able to do that they cannot today
labels: ["type:story", "needs-triage"]
body:
- type: markdown
attributes:
Expand Down
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/3-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Task
description: A piece of work with a clear finish line that is not a user-facing feature
labels: ["type:task", "needs-triage"]
body:
- type: markdown
attributes:
value: |
Chores, docs, CI, refactors, operations and playbook work. One task is one pull request.
**Never include real people's names, a PIN, a key or a token.**

- type: textarea
id: goal
attributes:
label: What needs doing
description: The outcome, in a sentence or two.
validations:
required: true

- type: textarea
id: done
attributes:
label: Done when
description: Checkable criteria. Someone else should be able to tell whether they are met.
placeholder: |
- [ ] ...
- [ ] ...
validations:
required: true

- type: input
id: epic
attributes:
label: Epic
description: The phase epic this belongs to, if any.
placeholder: kaffeelisten/.github#2

- type: textarea
id: notes
attributes:
label: Notes
description: Links, dependencies, anything a newcomer would need.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/4-spike.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Spike
description: A time-boxed question to answer before committing to an approach
labels: ["type:spike", "needs-triage"]
body:
- type: textarea
id: question
attributes:
label: The question
description: What we need to know, and which decision waits on the answer.
validations:
required: true

- type: input
id: timebox
attributes:
label: Time box
placeholder: Half a day
validations:
required: true

- type: textarea
id: output
attributes:
label: Output
description: What the spike leaves behind. Usually a short write-up and a recommendation, not production code.
validations:
required: true
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/5-epic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Epic
description: One phase of the build order, with its stories and tasks as sub-issues (maintainers)
title: "[P?] "
labels: ["type:epic"]
body:
- type: markdown
attributes:
value: |
Epics live in `kaffeelisten/.github`, one per phase, titled `[P2] …`. Their children can sit in
any repository of the organisation and are attached as native **sub-issues**. An epic is
never closed automatically: when its last sub-issue closes it gets `ready-for-acceptance`,
and a maintainer checks the outcome before closing it.

- type: textarea
id: outcome
attributes:
label: Outcome
description: What is true when this phase is done.
validations:
required: true

- type: textarea
id: criteria
attributes:
label: Done when
placeholder: |
- [ ] ...
validations:
required: true

- type: textarea
id: out-of-scope
attributes:
label: Not in this phase
11 changes: 10 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

Closes #

<!--
Link the issue this pull request completes: `Closes #12`, or `Closes kaffeelisten/playbook#3` for an
issue in another repository. A stack layer or a partial step says `Refs #12` instead. CI fails without
a link; the `no-issue` label exempts a trivial fix. The author is assigned automatically, the `type:*`
label comes from the title and the milestone from the issue.

Inside a stack, title each layer `[n/N] type(scope): summary` and list the stack here, bottom first.
-->

## How it was verified

<!-- What you actually ran or clicked. "CI is green" is not verification on its own. -->
Expand All @@ -26,7 +35,7 @@ Closes #
- [ ] `CHANGELOG.md` updated under `[Unreleased]` — or not applicable, nothing user-visible
- [ ] No secret, PIN, key or token in the diff, the description or a screenshot
- [ ] No real member names in fixtures, tests or screenshots
- [ ] Branch name and commits follow the conventions in `CONTRIBUTING.md`
- [ ] Branch name, commits and title follow the conventions in `CONTRIBUTING.md`

## Anything a reviewer should look at first

Expand Down
13 changes: 13 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Path-based area labels for pull requests (actions/labeler v5 syntax).
area:org:
- changed-files:
- any-glob-to-any-file: ['profile/**', 'CODE_OF_CONDUCT.md', 'SECURITY.md', 'CONTRIBUTING.md', '.github/ISSUE_TEMPLATE/**', '.github/PULL_REQUEST_TEMPLATE.md']
area:brand:
- changed-files:
- any-glob-to-any-file: ['brand/**']
area:delivery:
- changed-files:
- any-glob-to-any-file: ['.github/workflows/**', '.github/labeler.yml', 'scripts/**', 'workflow-templates/**']
area:docs:
- changed-files:
- any-glob-to-any-file: ['docs/**', '*.md']
24 changes: 24 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Checks

on:
pull_request:
branches: [main]
push:
branches: [main]

permissions:
contents: read

jobs:
scripts:
name: Convention scripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Unit tests
run: node --test scripts/conventions/conventions.test.cjs
- name: Config is valid JSON
run: node -e "JSON.parse(require('fs').readFileSync('scripts/conventions/project-config.json','utf8'))"
25 changes: 25 additions & 0 deletions .github/workflows/conventions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Conventions

# This repository's own caller of the shared conventions in org-conventions.yml. Every other
# repository calls the same workflow by its full path; see workflow-templates/conventions.yml.
on:
pull_request_target:
types: [opened, edited, reopened, synchronize, ready_for_review, converted_to_draft, labeled, unlabeled, closed]
issues:
types: [opened, reopened, closed, assigned, labeled]
issue_comment:
types: [created]
schedule:
- cron: '23 5 * * *'
workflow_dispatch:

permissions: {}

jobs:
conventions:
uses: ./.github/workflows/org-conventions.yml
permissions:
contents: read
issues: write
pull-requests: write
secrets: inherit
135 changes: 135 additions & 0 deletions .github/workflows/org-conventions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Conventions

# The organisation's shared conventions, called by a short `conventions.yml` in every repository
# (template: workflow-templates/conventions.yml). One entry point dispatches on the caller's event:
#
# pull request PR conventions: title, type label, linked issue, assignee, milestone; area labels
# /take, /drop self-assign or unassign an issue
# issue closed sub-issue roll-up: an epic whose children are all closed gets ready-for-acceptance
# any of these board sync, when the repository has a PROJECTS_TOKEN secret
#
# Under pull_request_target it checks out the caller's default branch and this repository's main,
# never the pull request's head, so no code from a pull request runs with these permissions.

on:
workflow_call:
secrets:
PROJECTS_TOKEN:
required: false

jobs:
pull-request:
name: PR conventions
if: github.event_name == 'pull_request_target' && github.event.action != 'closed'
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
pull-requests: write
concurrency:
group: pr-conventions-${{ github.repository }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false
- uses: actions/checkout@v4
with:
repository: kaffeelisten/.github
ref: main
path: .org
persist-credentials: false
- name: Area labels from changed paths
if: hashFiles('.github/labeler.yml') != ''
uses: actions/labeler@v5
with:
configuration-path: .github/labeler.yml
sync-labels: false
- name: Title, type label, issue link, assignee, milestone
uses: actions/github-script@v8
with:
script: |
await require('./.org/scripts/conventions/pr-conventions.cjs')({ github, context, core });

issue-command:
name: Issue command
if: >-
github.event_name == 'issue_comment' && !github.event.issue.pull_request &&
(startsWith(github.event.comment.body, '/take') || startsWith(github.event.comment.body, '/drop') ||
startsWith(github.event.comment.body, '/assign') || startsWith(github.event.comment.body, '/unassign'))
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v4
with:
repository: kaffeelisten/.github
ref: main
path: .org
persist-credentials: false
- uses: actions/github-script@v8
with:
script: |
await require('./.org/scripts/conventions/issue-commands.cjs')({ github, context, core });

roll-up:
name: Sub-issue roll-up
if: >-
(github.event_name == 'issues' && (github.event.action == 'closed' || github.event.action == 'reopened')) ||
(github.repository == 'kaffeelisten/.github' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'))
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
concurrency:
group: roll-up-${{ github.repository }}
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
with:
repository: kaffeelisten/.github
ref: main
path: .org
persist-credentials: false
- uses: actions/github-script@v8
with:
script: |
const rollup = require('./.org/scripts/conventions/sub-issue-rollup.cjs');
if (context.eventName === 'issues') await rollup({ github, context, core });
else await rollup.sweep({ github, context, core });

board:
name: Board sync
if: >-
github.event_name == 'pull_request_target' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' ||
(github.event_name == 'issues' && contains(fromJSON('["opened","reopened","closed","assigned","labeled"]'), github.event.action))
runs-on: ubuntu-latest
permissions:
contents: read
issues: read
pull-requests: read
concurrency:
group: board-${{ github.repository }}
cancel-in-progress: false
env:
PROJECTS_TOKEN: ${{ secrets.PROJECTS_TOKEN }}
steps:
- name: Skip without a project token
if: env.PROJECTS_TOKEN == ''
run: echo "::notice::No PROJECTS_TOKEN secret in this repository, so the board is not synced from here. See CONTRIBUTING.md, section 'The board'."
- uses: actions/checkout@v4
if: env.PROJECTS_TOKEN != ''
with:
repository: kaffeelisten/.github
ref: main
path: .org
persist-credentials: false
- uses: actions/github-script@v8
if: env.PROJECTS_TOKEN != ''
with:
github-token: ${{ env.PROJECTS_TOKEN }}
retries: 3
script: |
await require('./.org/scripts/conventions/project-sync.cjs')({ github, context, core });
Loading
Loading