Skip to content

Automatically update your Github Pull Request with a Shortcut title in the format: (feat) Some Feature [sc-12345]. And adds the Shortcut story's URL to the beginning of the body of your PR.

License

Notifications You must be signed in to change notification settings

farmersdog/clubhouse-pr

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

ClubHouse Pull Request Github Action

code style: prettier Test

Automatically update your Github Pull Request with data from your clubhouse story in the format: (feat) Some Feature [ch123]. Also adds the clubhouse story's URL to the beginning of the body of your PR.

This action is configured to extract the clubhouse story id form either the branch or title. It works best if you use the builtin git helpers to generate your branch names.

Inputs

ghToken

Required GITHUB_TOKEN

chToken

Required Clubhouse API Token

addStoryType

Optional Boolean to enable or disable prepending the story type to the PR title

Default true

useStoryNameTrigger

Optional When a PR is opened with this string as the title, fetch the story name from clubhouse

Default ch

Outputs

prTitle

The title of the pull request

Development

Run yarn tdd to watch Jest tests as you make your changes.

Run yarn lint:watch to watch for ESLint errors/warnings.

Note: Always run yarn build before pushing any changes.

Example usage

Note: This is for use when opening a pull request.

on:
  pull_request:
    types: [opened]
uses: actions/clubhouse-pr@v2
with:
  ghToken: ${{ secrets.GITHUB_TOKEN }}
  chToken: ${{ secrets.CLUBHOUSE_API_TOKEN }}

Example Transformations

The below assumes we are working on a clubhouse story with the following parameters

Name: A cool new feature

Story Type: feature

Story ID: 56789

Using the clubhouse story name for a PR title

A PR Opened As...

Title

ch

Body

- We did a thing
- Another thing
- Yay feature

Is updated to...

Title

(feature) A cool new feature [ch56789]

Body

Story details: https://app.clubhouse.io/farmersdog/story/56789

- We did a thing
- Another thing
- Yay feature

Using a custom PR title (aka don't use the story name)

A PR Opened As...

Title

We ended up not needing the cool new feature, tweaked a thing instead

Body

- This was an easy one, not much to say

Is updated to...

Title

(feature) We ended up not needing this, tweaked a thing instead [ch56789]

Body

Story details: https://app.clubhouse.io/farmersdog/story/56789

- This was an easy one, not much to say

About

Automatically update your Github Pull Request with a Shortcut title in the format: (feat) Some Feature [sc-12345]. And adds the Shortcut story's URL to the beginning of the body of your PR.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published