Files
backstage/plugins/github-actions
blam f326c2ee1e Merge branch 'master' of github.com:spotify/backstage into feat/backend-plugin
* 'master' of github.com:spotify/backstage: (30 commits)
  fix(techdocs-core): use the content of the readme as long description for the pypi package (#2578)
  chore: add contrib to CONTRIBUTING.md (#2585)
  Fix typo (#2584)
  backend-common: default config env to development
  v0.1.1-alpha.23
  TechDocs: Inject CSS transformer and initial backstage style integration for reader (#2560)
  bug(gql): use import to import the graphql module
  Rename file
  [blog] Announce CNCF Sandbox (#2568)
  document cleaning - tutorial quickstarts (#2520)
  Simplify codecov flag names
  chore(scaffolder-backend): typo in visibility
  Kubernetes plugins boilerplate (#2559)
  CHANGELOG: add entry for SessionApi refactor
  Upload package specific code coverage to codecov
  Add codecov flags for core and core-api packages
  TechDocs: Enable allowVulnerableTags in sanitize-html (#2554)
  chore: trust the Boolean :)
  docs: regenerate api reference docs
  core: refactor SessionStateApi to SessionApi with sign-in/out
  ...
2020-09-24 10:54:04 +02:00
..
2020-09-22 11:49:45 +02:00

GitHub Actions Plugin

Website: https://github.com/actions

Screenshots

TBD

Setup

Generic Requirements

  1. Provide OAuth credentials:

    1. Create an OAuth App with callback URL set to https://localhost:3000/auth/github.
    2. Take Client ID and Client Secret from the newly created app's settings page and put them into AUTH_GITHUB_CLIENT_ID and AUTH_GITHUB_CLIENT_SECRET env variables.
  2. Annotate your component with a correct GitHub Actions repository and owner:

    The annotation key is github.com/project-slug.

    Example:

    apiVersion: backstage.io/v1alpha1
    kind: Component
    metadata:
      name: backstage
      description: backstage.io
      annotations:
        github.com/project-slug: 'spotify/backstage'
    
    spec:
      type: website
      lifecycle: production
      owner: guest
    

Standalone app requirements

If you didn't clone this repo you have to do some extra work.

  1. Add plugin API to your Backstage instance:
yarn add @backstage/plugin-github-actions
// packages/app/src/api.ts
import { ApiRegistry } from '@backstage/core';
import { GithubActionsClient, githubActionsApiRef } from '@backstage/plugin-github-actions';

const builder = ApiRegistry.builder();
builder.add(githubActionsApiRef, new GithubActionsClient());

export default builder.build() as ApiHolder;
  1. Add plugin itself:
// packages/app/src/plugins.ts
export { plugin as GithubActions } from '@backstage/plugin-github-actions';
  1. Run the app with yarn start and the backend with yarn --cwd packages/backend start, navigate to /github-actions/.

Features

  • List workflow runs for a project
  • Dive into one run to see a job steps
  • Retry runs
  • Pagination for runs

Limitations

  • There is a limit of 100 apps for one OAuth client/token pair