Skip to content
Your buddy in managing and maintaining GitHub repositories.
Swift Ruby
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Assets [base branch] Renaming entries to GitBuddy (#9) Feb 6, 2020
Sources Update version Feb 13, 2020
Submodules Created a new release (#25) Feb 11, 2020
Tests
fastlane [base branch] Renaming entries to GitBuddy (#9) Feb 6, 2020
.gitignore Initial setup Jan 10, 2020
.gitmodules [base branch] Renaming entries to GitBuddy (#9) Feb 6, 2020
CODEOWNERS Implement CI (#6) Jan 22, 2020
Changelog.md Created a new release (#27) Feb 13, 2020
Dangerfile.swift
Gemfile Implement CI (#6) Jan 22, 2020
Gemfile.lock Migrate to Bitrise & Danger-Swift (#7) Jan 28, 2020
LICENSE Add version command and change to doner-case (#19) Feb 7, 2020
Package.swift Reference master Feb 13, 2020
README.md Add extra arguments for creating releases (#23) Feb 10, 2020

README.md

GitBuddy

Your buddy in managing and maintaining GitHub repositories.

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:
  --base-branch, -b   The base branch to compare with. Defaults to master.
  --help              Display available options
  --since-tag, -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
[112/112] Linking GitBuddy
OVERVIEW: Create a new release including a changelog and publish comments on related issues

OPTIONS:
  --base-branch, -b        The base branch to compare with for generating the changelog. Defaults to master.
  --changelog-path, -c     The path to the Changelog to update it with the latest changes
  --help                   Display available options
  --last-release-tag, -l   The last release tag to use as a base for the changelog creation. Default: previous tag
  --release-title, -r      The title of the release. Default: uses the tag name.
  --skip-comments, -s      Disable commenting on issues and PRs about the new release
  --tag-name, -n           The name of the tag. Default: takes the last created tag to publish as a GitHub release.
  --target-commitish, -t   Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master).
  --use-pre-release, -p    Create the release as a pre-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>

OPTIONS:
  --version   Prints the current GitBuddy version
  --help      Display available 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
You can’t perform that action at this time.