Skip to content

git-ty-up/actions-adapter

 
 

Repository files navigation

🔌 probot-actions-adapter

An adapter that takes a Probot app and makes it compatible with GitHub Actions

GitHub Actions status

Installation

npm i -S probot-actions-adapter

Usage

  1. Add an action.js to your Probot project, like the one shown below
  2. Add an action.yml to your Probot project, like the one shown below
  3. Vendor in your node_modules, as recommended by the official Actions documentation
  4. Optional, but recommended, update your project's README with an example workflow showing how to consume your action

Example action.js

// Require the adapter
const adapt = require('probot-actions-adapter');

// Require your Probot app's entrypoint, usually this is just index.js
const probot = require('./index');

// Adapt the Probot app for Actions
// This also acts as the main entrypoint for the Action
adapt(probot);

Example action.yml

name: 'Probot app name'
description: 'Probot app description.'
runs:
  using: 'node12'
  main: 'action.js'

See the documentation for action.yml syntax details.

Caveats

This adapter is designed to work well with Probot apps that are essentially stateless webhook handlers.

A few other limitations exist:

  1. The adapter will only work for Probot apps that receive webhook events that Actions also receives: https://help.github.com/en/articles/events-that-trigger-workflows
  2. The adapter will only work for Probot apps with a permissions set that is less than, or equivalent to the permission set attached to the GITHUB_TOKEN: https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions

If that's you, then great! 🚀

About

🔌 An adapter that takes a Probot app and makes it compatible with GitHub Actions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%