cbush / snooty-autobuilder-check

GitHub Action check for snooty autobuilder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

snooty-autobuilder-check

This is a GitHub Action that checks Snooty autobuilder for success. This is unofficial, unsupported, undocumented, unspellhcekced. YMMV.

Prerequisites

Check your repo Settings to ensure Actions are enabled:

image

⚠️ If your repo is private, you can't use Actions for free.

Usage in a GitHub Actions Workflow

This action assumes your repo uses snooty autobuilder, which is unlikely unless you work on MongoDB docs.

Create a workflow YAML file in your repo at /.github/workflows/check-autobuilder.yml:

name: Check Autobuilder for Errors

on:
  pull_request:
    paths:
      - "source/**"

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: cbush/snooty-autobuilder-check@main

For example: https://github.com/mongodb/docs-realm/blob/master/.github/workflows/check-autobuilder.yml

Usage Without GitHub Actions

You can run this script from a CI other than GitHub Actions. Clone this repo and in the clone directory, run:

npm install
npm run build
node . actor/owner/repo/branch

Leaving the slashes, replace actor/owner/repo/branch with the PR info:

  • actor - the username of the user who pushed to the branch (github.actor)
  • owner/repo - the org and repo name (github.event.pull_request.head.repo.full_name)
  • branch - the branch name (github.head_ref)

Examples

Across forks: user someuser opens a PR to merge the branch somebranch on the fork github.com/someuser/somerepo to the upstream repo github.com/someorg/somerepo:

node . someuser/someuser/somerepo/somebranch

Not across forks: user someuser opens a PR to merge the upstream branch somebranch to the upstream repo github.com/someorg/somerepo:

node . someuser/someorg/somerepo/somebranch

Additional commits by other users: user someotheruser adds a commit to the upstream branch somebranch, though the PR was opened by someuser:

node . someotheruser/someorg/somerepo/somebranch

About

GitHub Action check for snooty autobuilder

License:MIT License


Languages

Language:TypeScript 95.9%Language:JavaScript 4.1%