Skip to content

Commit a2f29e2

Browse files
authored
Move PR comment and version check into composite actions (#64)
* ci: move the PR test comment into a composite action Call it from the workflow with the self-repository syntax, so no checkout is needed. One run per pull request at a time. Fold the merge commit line into the archived table. * chore(deps): update catalogs + secure ci - Simplify `runner` commands in `autofix.yml` and `pages.yml` - Fix `GITHUB_ACTION_PATH` usage in `pr-test-comment` action - Migrate `package.json` to Bun catalogs for dependency management - Update `dprint`, `runner-run`, and `tombi` to latest versions - Add `.markdownlint.json` to disable line-length rules * ci: move the release version check into a composite action Both publish workflows call it with package and tag-prefix inputs. The two wrapper modules fold into the shared one, which reads its config from env. Import action modules by GITHUB_ACTION_PATH. * ci: resolve Bun catalog specs in the integration matrix The bw CLI pin now lives under catalogs.ci, so the config step follows catalog: references before parsing the version. * ci: collapse the PR test comment when the package is unchanged Gate on files that ship in the wheel instead of any .py file, and post the comment inside a details block when none changed. * revert: add back provenance Adapted the workflow from an existing PR comment bot configuration. Signed-off-by: Kaj Kowalski <info@kajkowalski.nl> --------- Signed-off-by: Kaj Kowalski <info@kajkowalski.nl>
1 parent a1c8af2 commit a2f29e2

19 files changed

Lines changed: 555 additions & 618 deletions
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# yaml-language-server: $schema=https://www.schemastore.org/github-action.json
2+
---
3+
name: PR Test Comment
4+
description: Create, update, and archive the "Test this PR" uvx comment on a pull request.
5+
author: Kaj Kowalski
6+
branding: { icon: message-square, color: blue }
7+
8+
inputs:
9+
cli-name:
10+
description: "Console script to run through `uvx`. Defaults to the repository name."
11+
default: ""
12+
python-version:
13+
description: "Python version passed as `uvx -p`. Empty omits the flag."
14+
default: ""
15+
cli-examples:
16+
description: "Example commands for the collapsed section; `{cmd}` expands to the `uvx` invocation."
17+
default: ""
18+
github-token:
19+
description: "Token with `issues:write` and `pull-requests:write`."
20+
default: ${{ github.token }}
21+
22+
runs:
23+
using: composite
24+
steps:
25+
- name: Create, update, or archive PR comment
26+
uses: actions/github-script@v9
27+
env:
28+
CLI_NAME: ${{ inputs.cli-name }}
29+
PYTHON_VERSION: ${{ inputs.python-version }}
30+
CLI_EXAMPLES: ${{ inputs.cli-examples }}
31+
with:
32+
github-token: ${{ inputs.github-token }}
33+
script: |
34+
const { default: comment } = await import(`${process.env.GITHUB_ACTION_PATH}/pr-comment.mjs`);
35+
return await comment({ core, context, github });

0 commit comments

Comments
 (0)