8

GitHub - WeTransfer/GitBuddy: Your buddy in managing and maintaining GitHub repo...

 4 years ago
source link: https://github.com/WeTransfer/GitBuddy
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

GitBuddy

Your buddy in managing and maintaining GitHub repositories.

68747470733a2f2f6170702e626974726973652e696f2f6170702f323537613039323339613133663330312e7376673f746f6b656e3d31694d53617664684f7747574b7559744b3966676f51 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c616e67756167652d7377696674352e312d6634383034312e7376673f7374796c653d666c6174 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e7376673f7374796c653d666c6174

GitBuddy helps you with:

  • Generating a changelog
  • Converting a tag into a GitHub release with a changelog attached
  • Commenting on issues and PRs when a releases contained the related code changes

Generating a changelog

$ gitbuddy changelog --help
OVERVIEW: Create a changelog for GitHub repositories

OPTIONS:
  --baseBranch, -b   The base branch to compare with. Defaults to master.
  --sinceTag, -s     The tag to use as a base. Defaults to the latest tag.
  --verbose          Show extra logging for debugging purposes

This command generates a changelog based on merged PRs and fixed issues. Once a PR contains a reference like "Fixed #30", the title of issue 30 will be included in the changelog. Otherwise, the Pull Request title will be used.

Pull requests that are merged into the baseBranch will be used as input for the changelog. Only pull requests that are merged after the creation date of the sinceTag are taken as input.

A Changelog example

This is an example taken from Mocker


  • Switch over to Danger-Swift & Bitrise (#34) via @AvdLee
  • Fix important mismatch for getting the right mock (#31) via @AvdLee

Generating a release

$ gitbuddy release --help
OVERVIEW: Create a new release including a changelog and publish comments on related issues

OPTIONS:
  --changelogPath, -c   The path to the Changelog to update it with the latest changes
  --skipComments, -s    Disable commenting on issues and PRs about the new release
  --verbose             Show extra logging for debugging purposes

The release command can be used to transform the latest tag into a GitHub release including the changelog as a body. The changelog is generated from all the changes between the latest and previous tag.

Updating the changelog file

The changelog is appended to the beginning of the changelog file if a changelogPath is passed. It's most commonly set to Changelog.md. It's best to use this on a release branch so you can commit the changes and open a PR.

Post comments

A great feature of this release command is the automation of posting comments to issues and PRs that are released with this release.

A comment posted on an issue

A comment posted on a pull request

Installation using Mint

You can install GitBuddy using Mint as follows:

$ mint install WeTransfer/GitBuddy

Setup a personal access token with the scope set to repo only. Add this token as an environment variable GITBUDDY_ACCESS_TOKEN by combining your GitHub username with the token:

export GITBUDDY_ACCESS_TOKEN="<username>:<access_token>"

The token is used with the GitHub API and uses Basic HTTP authentication.

After that you can directly use it by executing it from within the repo you would like to work with:

$ gitbuddy --help
OVERVIEW: Manage your GitHub repositories with ease

USAGE: GitBuddy <commands> <options>

SUBCOMMANDS:
  changelog   Create a changelog for GitHub repositories
  release     Create a new release including a changelog and publish comments on related issues

Development

  • cd into the repository
  • run swift package generate-xcodeproj (Generates an Xcode project for development)
  • Run the following command from the project you're using it for:
swift run --package-path ../GitBuddy/ GitBuddy --help

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK