README.md in gitlab-triage-0.5.0 vs README.md in gitlab-triage-0.6.0

- old
+ new

@@ -50,11 +50,11 @@ labels: - needs attention mention: - markglenfletcher comment: | - This issue is unlabelled after 5 days. It needs attention. + {{author}} This issue is unlabelled after 5 days. It needs attention. merge_requests: rules: [] ``` @@ -327,29 +327,59 @@ ##### Comment action Adds a comment to the resource. -Accepts a string. +Accepts a string, and placeholders. Placeholders should be wrapped in double +curly braces, e.g. `{{author}}`. -Example: +The following placeholders are supported: +- `created_at`: the resource's creation date +- `updated_at`: the resource's last update date +- `closed_at`: the resource's closed date (if applicable) +- `merged_at`: the resource's merged date (if applicable) +- `state`: the resources's current state: `opened`, `closed`, `merged` +- `author`: the username of the resource's author as `@user1` +- `assignee`: the username of the resource's assignee as `@user1` +- `assignees`: the usernames of the resource's assignees as `@user1, @user2` +- `closed_by`: the user that closed the resource as `@user1` (if applicable) +- `merged_by`: the user that merged the resource as `@user1` (if applicable) +- `milestone`: the resource's current milestone +- `labels`: the resource's labels as `~label1, ~label2` +- `upvotes`: the resources's upvotes count +- `downvotes`: the resources's downvotes count + +If the resource doesn't respond to the placeholder, or if the field is `nil`, +the placeholder is not replaced. + +Example without placeholders: + ```yml actions: comment: | Closing this issue automatically ``` +Example with placeholders: + +```yml +actions: + comment: | + @{{author}} Are you still interested in finishing this merge request? +``` + ### Usage ``` Usage: gitlab-triage [options] -n, --dry-run Don't actually update anything, just print -f, --policies-file [string] A valid policies YML file -p, --project-id [string] A project ID or path -t, --token [string] A valid API token + -H, --host-url [string] A valid host url -d, --debug Print debug information -h, --help Print help message --init Initialize the project with a policy file --init-ci Initialize the project with a .gitlab-ci.yml file ``` @@ -375,9 +405,24 @@ only: - schedules ``` > Note: You can use the [`--init-ci`](#usage) option to add an example [`.gitlab-ci.yml` file](support/.gitlab-ci.example.yml) to your project + +#### Can I use gitlab-triage for my self-hosted GitLab instance? + +Yes, you can override the host url using the following options: + +##### CLI +``` +gitlab-triage --dry-run --token $API_TOKEN --project-id gitlab-org/triage --host-url https://gitlab.host.com +``` + +##### Policy file +```yml +host_url: https://gitlab.host.com +resource_rules: +``` ### Contributing Please refer to the [Contributing Guide](CONTRIBUTING.md)