npm install
npm run bundle
will build the action for distribution.
npm run bundle
will build the action.- Prepare a ClickHouse Cloud database
- We need to add a table for Inference => PR association; assuming one inference per PR. Might be able to iterate.
- Configure the action inputs
clickhouse-url
,clickhouse-table
, and optional authentication parameters so the action can write inference to PR mappings after creating follow-up pull requests.
- Configure secrets for the repository:
- CI_BOT_OPENAI_API_KEY: OpenAI API key, used when starting TensorZero gateway
- CI_BOT_CLICKHOUSE_URL: ClickHouse URL for both TensorZero gateway and the
GitHub PR to inference mapping; expected format is
http[s]://[username:password@]hostname:port[/database]
.
- Configure GitHub Actions permissions for the repository:
- Under "Settings > Actions > General", check the box for "Allow GitHub Actions to create and approve pull requests".
We need to create a new table to store GitHub PR to Inference Map:
CREATE TABLE GitHubBotPullRequestToInferenceMap
(
pull_request_id UInt128,
inference_id String,
created_at DateTime DEFAULT now(),
original_pull_request_url String
)
ENGINE = ReplacingMergeTree
ORDER BY pull_request_id;
- Long context / large PRs
This project includes a helper script, script/release
designed to streamline the process of tagging and pushing new releases for
GitHub Actions.
GitHub Actions allows users to select a specific version of the action to use, based on release tags. This script simplifies this process by performing the following steps:
- Retrieving the latest release tag: The script starts by fetching the most recent SemVer release tag of the current branch, by looking at the local data available in your repository.
- Prompting for a new release tag: The user is then prompted to enter a new release tag. To assist with this, the script displays the tag retrieved in the previous step, and validates the format of the inputted tag (vX.X.X). The user is also reminded to update the version field in package.json.
- Tagging the new release: The script then tags a new release and syncs the
separate major tag (e.g. v1, v2) with the new release tag (e.g. v1.0.0,
v2.1.2). When the user is creating a new major release, the script
auto-detects this and creates a
releases/v#
branch for the previous major version. - Pushing changes to remote: Finally, the script pushes the necessary commits, tags and branches to the remote repository. From here, you will need to create a new release in GitHub so users can easily reference the new tags in their workflows.
This template includes a GitHub Actions workflow,
licensed.yml
, that uses
Licensed to check for dependencies with
missing or non-compliant licenses. This workflow is initially disabled. To
enable the workflow, follow the below steps.
-
Open
licensed.yml
-
Uncomment the following lines:
# pull_request: # branches: # - main # push: # branches: # - main
-
Save and commit the changes
Once complete, this workflow will run any time a pull request is created or
changes pushed directly to main
. If the workflow detects any dependencies with
missing or non-compliant licenses, it will fail the workflow and provide details
on the issue(s) found.
Whenever you install or update dependencies, you can use the Licensed CLI to update the licenses database. To install Licensed, see the project's Readme.
To update the cached licenses, run the following command:
licensed cache
To check the status of cached licenses, run the following command:
licensed status