Updates labels for a Github repository using a template file.

Github Labeler

The purpose of this application is to sync your default labels with a repository hosted by Github. Labeler automatically merges your labels into the repository using a template file.

After the run, missing labels are added, unknown labels are removed and existing labels are checked for changes.

Please note that label links to issues are lost when a label is removed.

Usage

Just run the binary and define the following arguments:

  • -t Your Github Token used for Github API requests
  • -o Your Github Username
  • -r The related repository name
labeler merge -t <token> -o <owner> -r <repo>

Optional arguments:

  • --dry-mode Activates dry mode (sumulation, no changes are made)
  • --skip-delete Skips deletion of unknown labels

You can also use the following environment variables to define default values.

  • LABELER_TOKEN
  • LABELER_OWNER
  • LABELER_REPO

Define labels

Labeler uses a JSON template file to merge the labels. The file must be placed under ~/.config/labeler/labels.json.

See labels.json for an example.

Development

Debugging

To set arguments in debug mode, create an .env file in the root of the repository.

Then add the following content to it:

LABELER_TOKEN=<GH API bearer token>
LABELER_OWNER=<GH username>
LABELER_REPO=<GH repository name>

If the file exists, VSCode applies the parameters as environment variables for the running process.

See .vscode/launch.json

Alternatively, you can override the parameter by setting the args section in the .vscode/launch.json file.

Please make sure you never push that file to Github. Because of this, the .env file is already excluded in the .gitignore file.

Build

Currently the app has not been added to any package manager.

If you want to use the app, you need to install and build it yourself.

go build -o labeler ./cmd/app/*.go

After that, just copy the binary to your preferred location.

cp labeler /usr/bin/

Alternatively, Go can also take care for the installation:

go install cmd/app/*.go
Comments
  • Add sub command

    Add sub command "version"

    Change the flag structure to sub commands to allow multiple modes.

    Initially change the syntax as bellow:

    • labeler merge ..
    • labeler version

    So it is possible to add multiple sub commands.

  • Insecure token flag

    Insecure token flag

    Tokens should not be passed to the CLI app as plain text flag parameters.

    Instead, the app should ask with Secure stdin without displaying the token in the terminal.

  • Add flag

    Add flag "--labels-file"

    Add the --labels-file flag to allow the user to specify the path to the labels configuration file.

    This makes Labeler more flexible in terms of multiple label definitions for different accounts etc.

  • Template file configurator

    Template file configurator

    It would be nice if labeler has a subcommand to generate the template file.

    Something like labeler configure

    Labeler could then ask for labels and automatically put in the needed values in the labels.json file under the right path.

  • Better error handling

    Better error handling

    Currently, error handling always causes the app to crash.

    It would be better to check if the labeler can retry the process instead of just crashing.

    More meningful error messages would also be nice.

A GitHub CLI extension that displays collaboration-related information about a GitHub repository.
A GitHub CLI extension that displays collaboration-related information about a GitHub repository.

collab-scanner GitHub CLI extension A GitHub CLI extension that displays collaboration-related information on a repository. Install gh extension insta

Dec 30, 2022
A cross platform desktop service that watches custom folders for file changes and updates the corresponding database in Notion.

A cross platform desktop service that watches custom folders for file changes and updates the corresponding database in Notion. Perfect for tracking reading lists

Mar 12, 2022
Keygen SDK for Go. Integrate license activation and automatic updates for Go binaries.

Keygen Go SDK Package keygen allows Go programs to license and remotely update themselves using the keygen.sh service. Usage keygen.Validate(fingerpri

Dec 18, 2022
Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://developer.github.com/v4/).

githubv4 Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://docs.github.com/en/graphql). If you're looking for a client

Dec 26, 2022
May 25, 2021
File-generator - Creates a file filled with bytes

creates a file filled with bytes ./filegen from to from : index of first piece t

Feb 14, 2022
Plot your repository stars over time.

Plot your repository stars over time.

Dec 30, 2022
This repository shows how can we use `AWS Lambda` to build serverless applications in golang.

Serverless Api in Go with AWS Lambda Here we are going to use AWS Lambda to build serverless applications in golang. Prerequisites You’ll need an AWS

Nov 3, 2021
Repository generator for Go

repogen repogen is a Golang Codegen that generates database query and mutation end-to-end with its model. How it works repogen describe our given tabl

Aug 4, 2022
This is the new api repository for Feel the Movies. Written in Go, totally open source.
This is the new api repository for Feel the Movies. Written in Go, totally open source.

This is the new API repository for Feel the Movies. Written in Go, totally open source. App Currently available for Android only. I have plans for an

Sep 18, 2022
Satisfactory Mod Repository (SMR) API

SMR API The Satisfactory Mod Repository backend API Running Execute: go run cmd/api/serve.go Configuration Running the API has a lot of pre-requisites

Feb 4, 2022
This repository will have code implemented for the 100 days of golang.

golang_100 This repository will have code implemented for the 100 days of golang. The resources I will use to do this 100 days golang programming are:

Jan 10, 2022
It is a package and command line application that provides you to store encrypted credentials/secrets in your repository.

sypher[ ⚠️ Work in progress] sypher provides you to store your credentials and secrets as encrypted in your repository. Usage Install the command line

Feb 23, 2022
A project template for a weather client in Go

A project template for a weather client in Go

Sep 17, 2022
Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure.
Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure.

tutor-pet API Simple CRUD API written in Go, built using AWS SAM tool and using the AWS' infrastructure. Macro architecture: Code architecture: Pre-Re

Aug 17, 2022
Asteroids written in Golang using raylib using an ECS system.

Asteroids written in Golang using Raylib using an ECS system.

Feb 12, 2022
Go library for accessing the GitHub API

go-github go-github is a Go client library for accessing the GitHub API v3. Currently, go-github requires Go version 1.9 or greater. go-github tracks

Dec 30, 2022
Go library for accessing trending repositories and developers at Github.
Go library for accessing trending repositories and developers at Github.

go-trending A package to retrieve trending repositories and developers from Github written in golang. This package were inspired by rochefort/git-tren

Dec 21, 2022
:fishing_pole_and_fish: Webhook receiver for GitHub, Bitbucket, GitLab, Gogs

Library webhooks Library webhooks allows for easy receiving and parsing of GitHub, Bitbucket and GitLab Webhook Events Features: Parses the entire pay

Jan 4, 2023