Request further actions from a check run
Building on the recent Checks API, we're providing further actions that users can request from a check run. This feature enables users to select an action offered by the app. For example, users can push a button in GitHub to request that the app fixes previously found linter errors.
Workflow
-
The integrator indicates that they can apply a further action. We designed these
actions
to be flexible for the integrator to specify which actions they can offer the user.For example, a linter type app with the ability to fix any failures found includes a "Fix" option, along with the check run input in the new
actions
input parameter:"actions": [{ "label": "Fix", "description": "Let us fix that for you", "identifier": "fix_errors" }]
-
GitHub surfaces possible actions for that check run in the pull request view.
The user selects the action they want carried out. For example, they click Fix:
-
GitHub sends a webhook event to the app with the details of the user request.
GitHub sends a check_run event with action of "requested_action" to the specific app. The payload includes the reference for the particular action requested by the user:
"requested_action": { "identifier": "fix_errors" }
The integrator's app carries out that action.
Use case
We used a linter app as a use case in the previous examples. This app needs write
permission on the contents
of the repository if you want it to apply the fixes and commit the changed code to the same branch. In GitHub, these changes might look this:
To learn more about how an app can clone and access a repository for making changes, see "HTTP-based Git access by an installation."
How can I try it?
Anyone can register a GitHub App on GitHub through Settings > Developer settings > GitHub Apps and manage an existing GitHub App from the same place. See how to get started building GitHub Apps.
For more details, refer to the full Checks API documentation.
To access this functionality, you’ll need to provide the following custom media type in the Accept
header:
application/vnd.github.antiope-preview+json
Share your feedback
We're excited to see what you build with these new improvements. If you have any questions, please let us know.