Tags PRs of first time contributors in a GitHub repo with a pre specified label and has builtin caching.
This repository also contains a Nix flake. It can be used in a NixOS configuration like this:
- Add flake to inputs:
first-time-contribution-tagger = {
url = "github:Janik-Haag/first-time-contribution-tagger";
inputs.nixpkgs.follows = "nixpkgs"; #optional
}
- Adding output:
outputs = inputs@{ self, nixpkgs, first-time-contribution-tagger, ... }:
- Import NixOS module
imports = [ first-time-contribution-tagger.nixosModule ];
- Configure the module:
{ ... }: {
services.first-time-contribution-tagger = {
enable = true;
interval = "*:0/10";
environment = {
FIRST_TIME_CONTRIBUTION_LABEL="12. first-time contribution";
FIRST_TIME_CONTRIBUTION_CACHE="/var/lib/first-time-contribution-tagger/cache";
FIRST_TIME_CONTRIBUTION_REPO="nixpkgs";
FIRST_TIME_CONTRIBUTION_ORG="NixOS";
};
environmentFile = "/root/first-time-contribution-tagger.env";
};
}
-
Adding the cache If you go to the releases page you will find two .pickle files, copy both of them to your specified cache directory. If the directory doesn't exist just create it. Then set the permissions, f.e.
chmod -R 666 $FIRST_TIME_CONTRIBUTION_CACHE
-
Rebuild your system config
sudo nixos-rebuild switch --flake .#