Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cbush/snooty-autobuilder-check

GitHub Action check for snooty autobuilder
https://github.com/cbush/snooty-autobuilder-check

Last synced: 2 months ago
JSON representation

GitHub Action check for snooty autobuilder

Awesome Lists containing this project

README

        

# 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:

```yaml
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:

```sh
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`:

```sh
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`:

```sh
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`:

```sh
node . someotheruser/someorg/somerepo/somebranch
```