Repository navigation
ci: set and read board fields through a Board workflow - #65
Merged
Merged
Conversation
Adds a workflow_dispatch workflow, Board, that reads an item's project fields, lists the board, or sets fields (Worker, Status, Area, Release, ...) with the PROJECT_TOKEN secret, and .github/board.sh, which starts it over the REST API, waits and prints the result. Tools without access to GitHub Projects use it instead of labels. The Project workflow no longer mirrors worker: and status: labels into the board; it only adds new issues and pull requests.
A public repository's job logs, summaries and run names are public. The Board workflow now lists and accepts only items of public repositories when it runs in a public repository, and board.sh runs it in tripletrail-enterprise by default; a bare number still means an item of the checkout's own repository.
issueOrPullRequest cannot be a draft issue, so GitHub rejected the query and every single-item run failed.
A run can report completed before its conclusion is set, which made board.sh report a successful run as failed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Tools that only have the REST API with a repository-scoped token cannot reach GitHub Projects, so they can neither read nor set the board's fields. They can start workflows and read job logs, so this adds a Board workflow (
workflow_dispatch) that does the project work with thePROJECT_TOKENsecret:itemempty lists every open item on the board (allincludes closed ones), one row per item with its Status, Worker, Area, Release and other fields.item=42ortripletrail-demo#3shows that item's fields.set=Worker=Builder 1; Status=In progresssets fields (single select, text, number, date). Names match without regard to case, dashes may stand for spaces, an empty value clears. An item not on the board yet is added first. An unknown field or option fails the run and lists the valid names.The result is printed between
----- board result -----/----- end -----in the job log as a tab-separated table, and in the run summary..github/board.shstarts the run over the REST API, finds it by a request id in its run name, waits for its conclusion and prints the table (exit 1 when the run fails).A public repository's logs are public, so a run in a public repository lists and accepts only items of public repositories;
board.shruns the workflow in a private repository by default.The Project workflow no longer mirrors
worker:/status:labels into the board; it only adds new issues and pull requests (and the manual backfill).How it was tested
github.graphql: listing (open/all) in a public and a private repository, reading, setting, clearing, a private item asked for from a public repository, and bad field/option names.bash -nonboard.sh.Documentation