This bot is deprecated and is planned for shutdown August 6, 2025.
You can replicate trusted-contribution's functionality using GitHub actions
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
if: github.actor == '<name-of-actor>'
with:
script: |
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: ['<label-to-add>']
})
A GitHub App built with Probot that will run Kokoro CI if the PR is created by a trusted contributor.
# Install dependencies
npm install
# Run the bot
npm startTo configure the bot, you can create a configuration file:
.github/trusted-contribution.yml. The contents of this file allow for the following
options:
| Name | Description | Type | Default |
|---|---|---|---|
trustedContributors |
List of user login names that are considered trusted | string[] |
['renovate-bot', 'release-please[bot]', 'gcf-merge-on-green[bot]'] |
commentInstructions |
Whether to comment on the PR with instructions for the maintainers | boolean |
false |
annotations |
The list of annotation objects to leave the on the PR | object |
{ type: 'label'; text: 'kokoro:force-run' } |
annotation.type |
Configure the bot to either comment on the PR or add a label | comment |
label |
annotation.text |
The label text or comment text to be left on the PR | string |
kokoro:force-run |
- metadata - read
- pull requests - read & write
- None
- None
- pull request
This bot uses nock for mocking requests to GitHub, and snap-shot-it for capturing responses; This allows updates to the API surface to be treated as a visual diff, rather than tediously asserting against each field.
Running tests:
npm run testTo update snapshots:
npm run test:snapIf you have suggestions for how trusted-contribution could be improved, or want to report a bug, open an issue! We'd love all and any contributions.
For more, check out the Contributing Guide.
Apache 2.0 © 2019 Google Inc.