Skip to content

ci: add issues and pull requests to the TripleTrail project - #59

Open
MathiasVDA wants to merge 5 commits into
mainfrom
claude/project-thread-61i9m4
Open

MathiasVDA wants to merge 5 commits into
mainfrom
claude/project-thread-61i9m4

Conversation

@MathiasVDA

@MathiasVDA MathiasVDA commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The project's own auto-add workflow covers one repository only. This workflow (.github/workflows/project.yml) adds this repository's issues and pull requests to the organisation project TripleTrail:

  • New and reopened issues and pull requests are added as they come in. The project's "Item added" workflow then sets their Status.
  • Labels set the board's fields, so contributors without project access can claim work. worker:<option> sets Worker (e.g. worker:builder-1) and status:<option> sets Status (e.g. status:blocked); the option name is matched in lower case with dashes for spaces. Only the label that changed is synced, so unrelated labels do nothing and a field set later on the board stays as it is. Removing a worker: label falls back to another worker: label or clears Worker.
  • A manual run (Actions → Project → Run workflow) adds every existing issue and pull request, open and closed. Adding an item that is already there changes nothing, so it can run again safely.

Pull requests use pull_request_target so that ones from forks are added too. The job checks out no code, so nothing from the pull request runs with the secret. Without the secret the job passes with a notice. The same file goes to all five TripleTrail repositories; the private ones run it on the NUC.

It needs the repository secret PROJECT_TOKEN, because GITHUB_TOKEN cannot write to an organisation project: a fine-grained personal access token with resource owner Matdata-eu, the organisation permission "Projects: Read and write", and the repository permissions "Issues: Read" and "Pull requests: Read" on the TripleTrail repositories.

New action: actions/github-script@v8 (MIT, by GitHub).

How it was tested

YAML parses and the embedded script passes node --check. The backfill ran green in the four other repositories. The label logic was run against a mocked GitHub API: opened with labels, setting both fields, an unrelated label, two worker labels, an unknown option, reopening, and removing a worker or status label.

Documentation

  • No user-facing change

New, reopened and transferred issues and pull requests are added to the
organisation project as they come in. A manual run adds every existing
one, open and closed. Needs the organisation secret PROJECT_TOKEN.
A transferred issue fires in the repository it leaves, and the new
repository already sees it as opened. github-script v8 runs on Node 24,
which the runners now force anyway. The comment names the secret as a
repository secret.
Without the secret, on a fork's pull request or before it is added, the
job now prints a notice and passes instead of failing every pull request.
Threads and people without access to the project can claim an item by
labelling it: worker:builder-1 sets Worker, status:blocked sets Status.
The option name is matched in lower case with dashes for spaces. Removing
the last worker: label clears Worker; unrelated labels leave fields set
by hand on the board alone.
Re-applying every label on each label event overwrote board changes made
later, such as Done from the project's own workflow. Now a labeled event
sets only its own field, removing a worker: label falls back to another
worker: label or clears Worker, and a new item applies the labels it was
created with. Concurrency is per item and label, so two labels added at
once are both synced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant