From 5a4d5d006ade22ad7ae960d2391fcdabf3b96ea3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 7 Oct 2024 04:19:42 +0000 Subject: [PATCH] deploy: suzuki-shunsuke/github-comment-docs@1de018cd38a38665bbb79e10ce464fc468ad4a9c --- docs/404.html | 4 ++-- .../js/{runtime~main.5db191ff.js => runtime~main.38c2d08a.js} | 2 +- docs/builtin-template/index.html | 4 ++-- docs/complement/index.html | 4 ++-- docs/config/index.html | 4 ++-- docs/feature/index.html | 4 ++-- docs/getting-started/index.html | 4 ++-- docs/github-enterprise/index.html | 4 ++-- docs/hide/index.html | 4 ++-- docs/index.html | 4 ++-- docs/install/index.html | 4 ++-- docs/search/index.html | 4 ++-- docs/usage/index.html | 4 ++-- 13 files changed, 25 insertions(+), 25 deletions(-) rename docs/assets/js/{runtime~main.5db191ff.js => runtime~main.38c2d08a.js} (55%) diff --git a/docs/404.html b/docs/404.html index ae334065..d93bbf7c 100644 --- a/docs/404.html +++ b/docs/404.html @@ -4,13 +4,13 @@ Page Not Found | github-comment - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/docs/assets/js/runtime~main.5db191ff.js b/docs/assets/js/runtime~main.38c2d08a.js similarity index 55% rename from docs/assets/js/runtime~main.5db191ff.js rename to docs/assets/js/runtime~main.38c2d08a.js index 7dd6fb70..d4ff6e1b 100644 --- a/docs/assets/js/runtime~main.5db191ff.js +++ b/docs/assets/js/runtime~main.38c2d08a.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r,a,o,n={},c={};function d(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,d),r.loaded=!0,r.exports}d.m=n,d.c=c,e=[],d.O=(t,r,a,o)=>{if(!r){var n=1/0;for(u=0;u=o)&&Object.keys(d.O).every((e=>d.O[e](r[f])))?r.splice(f--,1):(c=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,a,o]},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);d.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var c=2&a&&e;"object"==typeof c&&!~t.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,d.d(o,n),o},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((t,r)=>(d.f[r](e,t),t)),[])),d.u=e=>"assets/js/"+({82:"9f0307ff",138:"1a4e3797",259:"125efe5c",265:"a6a06bdd",401:"17896441",429:"e5bd44ea",581:"935f2afb",614:"576fb8c2",684:"2da2e04c",714:"1be78505",722:"6476eba6",742:"c377a04b",777:"c4de80f8",895:"b81c6bfd",924:"d589d3a7",950:"9225b3a9"}[e]||e)+"."+{82:"965fa52e",138:"2b4956e3",158:"93c2db75",259:"9cef4a00",265:"afe02de1",401:"fa2e1c73",416:"dbf80d9f",429:"5e3a4f59",581:"aea8fd54",614:"7ec74a14",684:"84f80a5f",714:"a79e70a2",722:"bce9a971",742:"decc292e",774:"46ca386e",777:"8f445611",895:"1dc7a974",913:"d0f07ca0",924:"b5ef9f37",950:"8922b658"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="github-comment:",d.l=(e,t,r,n)=>{if(a[e])a[e].push(t);else{var c,f;if(void 0!==r)for(var i=document.getElementsByTagName("script"),u=0;u{c.onerror=c.onload=null,clearTimeout(s);var o=a[e];if(delete a[e],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=l.bind(null,c.onerror),c.onload=l.bind(null,c.onload),f&&document.head.appendChild(c)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/github-comment/",d.gca=function(e){return e={17896441:"401","9f0307ff":"82","1a4e3797":"138","125efe5c":"259",a6a06bdd:"265",e5bd44ea:"429","935f2afb":"581","576fb8c2":"614","2da2e04c":"684","1be78505":"714","6476eba6":"722",c377a04b:"742",c4de80f8:"777",b81c6bfd:"895",d589d3a7:"924","9225b3a9":"950"}[e]||e,d.p+d.u(e)},(()=>{var e={354:0,869:0};d.f.j=(t,r)=>{var a=d.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(354|869)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var n=d.p+d.u(t),c=new Error;d.l(n,(r=>{if(d.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",c.name="ChunkLoadError",c.type=o,c.request=n,a[1](c)}}),"chunk-"+t,t)}},d.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,n=r[0],c=r[1],f=r[2],i=0;if(n.some((t=>0!==e[t]))){for(a in c)d.o(c,a)&&(d.m[a]=c[a]);if(f)var u=f(d)}for(t&&t(r);i{"use strict";var e,t,r,o,a,n={},c={};function d(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,d),r.loaded=!0,r.exports}d.m=n,d.c=c,e=[],d.O=(t,r,o,a)=>{if(!r){var n=1/0;for(u=0;u=a)&&Object.keys(d.O).every((e=>d.O[e](r[f])))?r.splice(f--,1):(c=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[r,o,a]},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var a=Object.create(null);d.r(a);var n={};t=t||[null,r({}),r([]),r(r)];for(var c=2&o&&e;"object"==typeof c&&!~t.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,d.d(a,n),a},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((t,r)=>(d.f[r](e,t),t)),[])),d.u=e=>"assets/js/"+({82:"9f0307ff",138:"1a4e3797",259:"125efe5c",265:"a6a06bdd",401:"17896441",429:"e5bd44ea",581:"935f2afb",614:"576fb8c2",684:"2da2e04c",714:"1be78505",722:"6476eba6",742:"c377a04b",777:"c4de80f8",895:"b81c6bfd",924:"d589d3a7",950:"9225b3a9"}[e]||e)+"."+{82:"965fa52e",138:"2b4956e3",158:"93c2db75",259:"9cef4a00",265:"afe02de1",401:"fa2e1c73",416:"dbf80d9f",429:"5e3a4f59",581:"aea8fd54",614:"7ec74a14",684:"84f80a5f",714:"a79e70a2",722:"bce9a971",742:"decc292e",774:"46ca386e",777:"8f445611",895:"1dc7a974",913:"d0f07ca0",924:"b5ef9f37",950:"8922b658"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},a="github-comment:",d.l=(e,t,r,n)=>{if(o[e])o[e].push(t);else{var c,f;if(void 0!==r)for(var i=document.getElementsByTagName("script"),u=0;u{c.onerror=c.onload=null,clearTimeout(s);var a=o[e];if(delete o[e],c.parentNode&&c.parentNode.removeChild(c),a&&a.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=l.bind(null,c.onerror),c.onload=l.bind(null,c.onload),f&&document.head.appendChild(c)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/github-comment/",d.gca=function(e){return e={17896441:"401","9f0307ff":"82","1a4e3797":"138","125efe5c":"259",a6a06bdd:"265",e5bd44ea:"429","935f2afb":"581","576fb8c2":"614","2da2e04c":"684","1be78505":"714","6476eba6":"722",c377a04b:"742",c4de80f8:"777",b81c6bfd:"895",d589d3a7:"924","9225b3a9":"950"}[e]||e,d.p+d.u(e)},(()=>{var e={354:0,869:0};d.f.j=(t,r)=>{var o=d.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else if(/^(354|869)$/.test(t))e[t]=0;else{var a=new Promise(((r,a)=>o=e[t]=[r,a]));r.push(o[2]=a);var n=d.p+d.u(t),c=new Error;d.l(n,(r=>{if(d.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+a+": "+n+")",c.name="ChunkLoadError",c.type=a,c.request=n,o[1](c)}}),"chunk-"+t,t)}},d.O.j=t=>0===e[t];var t=(t,r)=>{var o,a,n=r[0],c=r[1],f=r[2],i=0;if(n.some((t=>0!==e[t]))){for(o in c)d.o(c,o)&&(d.m[o]=c[o]);if(f)var u=f(d)}for(t&&t(r);i Builtin Templates | github-comment - +

Builtin Templates

Some default templates are provided. They are overwritten if the same name templates are defined in the configuration file.

status

Usage:

{{template "status" .}}

Content of the template:

:{{if eq .ExitCode 0}}white_check_mark{{else}}x{{end}}:

join_command

Usage:

{{template "join_command" .}}

Content of the template:

If .JoinCommand includes ```,

<pre><code>$ {{.JoinCommand | AvoidHTMLEscape}}</pre></code>

Otherwise,

```
$ {{.JoinCommand | AvoidHTMLEscape}}
```

hidden_combined_output

Usage:

{{template "hidden_combined_output" .}}

Content of the template:

If .CombinedOutput includes ``` ,

<details><pre><code>{{.CombinedOutput | AvoidHTMLEscape}}</code></pre></details>

Otherwise,

<details>
```
{{.CombinedOutput | AvoidHTMLEscape}}
```
</details>

Usage:

{{template "link" .}}

Content of the template:

link is different per CI service.

CircleCI

[workflow](https://circleci.com/workflow-run/{{env "CIRCLE_WORKFLOW_ID" }}) [job]({{env "CIRCLE_BUILD_URL"}}) (job: {{env "CIRCLE_JOB"}})

CodeBuild

[Build link]({{env "CODEBUILD_BUILD_URL"}})

Drone

[build]({{env "DRONE_BUILD_LINK"}}) [step]({{env "DRONE_BUILD_LINK"}}/{{env "DRONE_STAGE_NUMBER"}}/{{env "DRONE_STEP_NUMBER"}})

GitHub Actions

[Build link](https://github.com/{{env "GITHUB_REPOSITORY"}}/actions/runs/{{env "GITHUB_RUN_ID"}})

exec's default template

when: ExitCode != 0
template: |
{{template "status" .}} {{template "link" .}}

{{template "join_command" .}}

{{template "hidden_combined_output" .}}
- + \ No newline at end of file diff --git a/docs/complement/index.html b/docs/complement/index.html index bd1c932a..3f38d4ff 100644 --- a/docs/complement/index.html +++ b/docs/complement/index.html @@ -4,14 +4,14 @@ Complement | github-comment - +

Complement

Complement options with Platform's built-in Environment variables

The following platforms are supported.

  • CircleCI
  • GitHub Actions
  • Drone
  • AWS CodeBuild
  • Google Cloud Build

To complement, suzuki-shunske/go-ci-env is used.

Google Cloud Build Support

#521, github-comment >= v4.4.0

Set the environment variable GOOGLE_CLOUD_BUILD.

GOOGLE_CLOUD_BUILD=true

Set the following environment variables using substitutions.

  • COMMIT_SHA
  • BUILD_ID
  • PROJECT_ID
  • _PR_NUMBER
  • _REGION

Specify the repository owner and name in github-comment.yaml.

e.g.

github-comment.yaml

base:
org: suzuki-shunsuke
repo: github-comment

Complement the pull request number from CI_INFO_PR_NUMBER

The environment variable CI_INFO_PR_NUMBER is set by ci-info by default. If the pull request number can't be gotten from platform's built-in environment variables but CI_INFO_PR_NUMBER is set, github-comment uses CI_INFO_PR_NUMBER.

Complement options with any environment variables

caution

This feature was removed from v5.0.0 for security reason.

- + \ No newline at end of file diff --git a/docs/config/index.html b/docs/config/index.html index 11148644..320e84c2 100644 --- a/docs/config/index.html +++ b/docs/config/index.html @@ -4,7 +4,7 @@ Configuration | github-comment - + @@ -16,7 +16,7 @@ When the evaluation result is false the element is ignored, and the first matching element is used. If dont_comment is true, the comment isn't created. If no element matches, the comment isn't created without error.

Define reusable template components

templates:
<template name>: <template content>
post:
default:
template: |
{{template "<template name>" .}} ...

Define variables

vars:
<variable name>: <variable value>
post:
default:
template: |
{{.Vars.<variable name>}} ...

The variable can be passed with the option -var <variable name>:<variable value> too.

e.g.

$ github-comment post -var name:foo

See also

- + \ No newline at end of file diff --git a/docs/feature/index.html b/docs/feature/index.html index de1c9e1d..8bd7cfe2 100644 --- a/docs/feature/index.html +++ b/docs/feature/index.html @@ -4,7 +4,7 @@ Feature | github-comment - + @@ -14,7 +14,7 @@ If the GitHub Access Token is set, this option is ignored. If the GitHub Access Token isn't set, this option works like --dry-run.

Skip to send a comment with Environment variable

https://github.com/suzuki-shunsuke/github-comment/issues/143

When you try to run shell scripts for CI on local for testing, in many case you don't want to send a comment. So github-comment supports to skip to send a comment with an environment variable.

Set the environment variable GITHUB_COMMENT_SKIP to true.

$ export GITHUB_COMMENT_SKIP=true
$ github-comment post -template test # Do nothing
$ github-comment exec -- echo hello # a command is run but a comment isn't sent
hello
- + \ No newline at end of file diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html index 79b306b3..6ca69b6d 100644 --- a/docs/getting-started/index.html +++ b/docs/getting-started/index.html @@ -4,7 +4,7 @@ Getting Started | github-comment - + @@ -14,7 +14,7 @@ Instead of pull request, you can send a comment to a commit

$ github-comment post -org suzuki-shunsuke -repo github-comment -sha1 36b1ade9740768f3645c240d487b53bee9e42702 -template test

https://github.com/suzuki-shunsuke/github-comment/commit/36b1ade9740768f3645c240d487b53bee9e42702#commitcomment-37933181

comment-to-commit

The template is rendered with Go's text/template.

You can write the template in the configuration file.

github-comment.yaml

post:
default:
template: |
{{.Org}}/{{.Repo}} test
hello:
template: |
hello world

If the argument -template is given, the configuration file is ignored. You can define multiple templates in the configuration file and specify the template by the argument -template-key (-k).

$ github-comment post -k hello

If -template and -template-key aren't set, the template default is used.

exec

Let's add the following configuration in the configuration file.

exec:
hello:
- when: true
template: |
exit code: {{.ExitCode}}

```
$ {{.Command}}
```

Stdout:

```
{{.Stdout}}
```

Stderr:

```
{{.Stderr}}
```

CombinedOutput:

```
{{.CombinedOutput}}
```

Then run a command and send the result as a comment.

$ github-comment exec -org suzuki-shunsuke -repo github-comment -pr 1 -k hello -- bash -c "echo foo; echo bar >&2; echo zoo"
bar
foo
zoo

https://github.com/suzuki-shunsuke/github-comment/pull/1#issuecomment-601503124

exec-1

Let's send the comment only if the command failed. Update the above configuration.

exec:
hello:
- when: ExitCode != 0
template: |
...

Run the above command again, then the command wouldn't be created.

If the command failed, then the comment is created.

$ github-comment exec -org suzuki-shunsuke -repo github-comment -pr 1 -k hello -- curl -f https://github.com/suzuki-shunsuke/not_found
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404 Not Found
exit status 22

https://github.com/suzuki-shunsuke/github-comment/pull/1#issuecomment-601505610

You can change the template by the command result.

exec:
hello:
- when: ExitCode != 0
template: |
command failed
- when: ExitCode == 0
template: |
command is succeeded

By dont_comment, you can define the condition which the message isn't created.

exec:
hello:
- when: ExitCode != 0
dont_comment: true
- when: true
template: |
Hello, world
- + \ No newline at end of file diff --git a/docs/github-enterprise/index.html b/docs/github-enterprise/index.html index 86cc17c0..2d6c2646 100644 --- a/docs/github-enterprise/index.html +++ b/docs/github-enterprise/index.html @@ -4,14 +4,14 @@ GitHub Enterprise Support | github-comment - +

GitHub Enterprise Support

danger

I (@suzuki-shunsuke) don't use GitHub Enterprise, so I can't confirm if github-comment works well for GitHub Enterprise.

github-comment >= v4.2.0

#462 #464

note

From github-comment v6.2.0, github-comment gets GitHub API endpoints from environment variables GITHUB_API_URL and GITHUB_GRAPHQL_URL, which are built-in variables of GitHub Actions.

Please set the following fields in configuration file github-comment.yaml.

GitHub Enterprise Server

ghe_base_url: http(s)://<your_enterprise_hostname> # CHANGE
ghe_graphql_endpoint: http(s)://<your_enterprise_hostname>/api/graphql # CHANGE

See. https://docs.github.com/en/enterprise-server/graphql/guides/forming-calls-with-graphql#the-graphql-endpoint

GitHub Enterprise Cloud

ghe_base_url: https://api.github.com
ghe_graphql_endpoint: https://api.github.com/graphql

See. https://docs.github.com/en/enterprise-cloud@latest/graphql/guides/forming-calls-with-graphql#the-graphql-endpoint

- + \ No newline at end of file diff --git a/docs/hide/index.html b/docs/hide/index.html index 0a49cb6e..934ceb00 100644 --- a/docs/hide/index.html +++ b/docs/hide/index.html @@ -4,7 +4,7 @@ Hide comments | github-comment - + @@ -14,7 +14,7 @@ You would like to hide outdated comments.

By the subcommand hide, you can hide outdated comments. From github-comment v3, github-comments injects meta data like SHA1 into comments as HTML comment.

e.g.

<!-- github-comment: {"JobID":"xxx","JobName":"plan","SHA1":"79acc0778da6660712a65fd41a48b72cb7ad16c0","TemplateKey":"default","Vars":{}} -->

The following meta data is injected.

  • JobName (support only some CI platform)
  • JobID (support only some CI platform)
  • WorkflowName (support only some CI platform)
  • TemplateKey
  • Vars
  • SHA1

From github-comment v4, only variables specified by embedded_var_names are embedded into the comment.

In hide command, github-comment does the following things.

  1. gets the list of pull request (issue) comments
  2. extracts the injected meta data from comments
  3. hide comments which match the expr expression

The following variable is passed to the expression.

  • Commit:
    • Org
    • Repo
    • PRNumber
    • SHA1
  • Comment
    • Body
    • HasMeta
    • Meta
      • SHA1
      • TemplateKey
      • Vars
  • HideKey
  • Vars
  • Env: func(string) string

The default condition is Comment.HasMeta && Comment.Meta.SHA1 != Commit.SHA1. you can configure the condition in the configuration file.

hide:
default: "true"
hello: 'Comment.HasMeta && (Comment.Meta.SHA1 != Commit.SHA1 && Comment.Meta.Vars.target == "hello")'

you can specify the template with --hide-key (-k) option.

$ github-comment hide -k hello

If the template isn't specified, the template default is used.

you can specify the condition with -condition option.

$ github-comment hide -condition 'Comment.Body contains "foo"'
- + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 1d3b160b..58109ca8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,7 @@ github-comment | github-comment - + @@ -17,7 +17,7 @@ users can understand what the problem is and what they should do quickly.

It's bothersome to check CI log and investigate what command failed and why it failed. If you run a shell script, it may be difficult to understand what command failed.

Please see the following screenshot. ref

You would be able to understand the failed command and its log quickly.

image

You can also post a guide. ref

image

By the guide, users would be able to solve the problem by temselves. This improves the productivity of both Developer and DevOps Engineer.

github-comment also supports hiding old comments, which makes pull requests clean.

Features

  • Easy to install
    • github-comment is a single executable binary written in Go. No dependency is needed
  • Post comments according to the result of command
    • For example, you can post comment only when the command failed or the specific phrase is outputted
  • Hide old comments conditionally
  • Get CI information automatically from CI Environment variables
  • Manage configuration with YAML
    • You can separate CI script and github-comment configuration
  • Provide built-in templates

Blog

Written in Japanese.

Release Notes

GitHub Releases

- + \ No newline at end of file diff --git a/docs/install/index.html b/docs/install/index.html index 4b5917c1..ef95ce0e 100644 --- a/docs/install/index.html +++ b/docs/install/index.html @@ -4,13 +4,13 @@ Install | github-comment - +

Install

Homebrew

You can install github-comment with Homebrew.

$ brew install suzuki-shunsuke/github-comment/github-comment

aqua

You can install github-comment with aqua.

$ aqua g -i suzuki-shunsuke/github-comment

GitHub Releases

Please download a binary from the release page.

Verify downloaded binaries from GitHub Releases

You can verify downloaded binaries using some tools.

  1. Cosign
  2. slsa-verifier
  3. GitHub CLI

1. Cosign

You can install Cosign by aqua.

aqua g -i sigstore/cosign
gh release download -R suzuki-shunsuke/github-comment v6.2.1
cosign verify-blob \
--signature github-comment_6.2.1_checksums.txt.sig \
--certificate github-comment_6.2.1_checksums.txt.pem \
--certificate-identity-regexp 'https://github\.com/suzuki-shunsuke/go-release-workflow/\.github/workflows/release\.yaml@.*' \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
github-comment_6.2.1_checksums.txt

Output:

Verified OK

After verifying the checksum, verify the artifact.

cat github-comment_6.2.1_checksums.txt | sha256sum -c --ignore-missing

2. slsa-verifier

You can install slsa-verifier by aqua.

aqua g -i slsa-framework/slsa-verifier
gh release download -R suzuki-shunsuke/github-comment v6.2.1
slsa-verifier verify-artifact github-comment_6.2.1_darwin_arm64.tar.gz \
--provenance-path multiple.intoto.jsonl \
--source-uri github.com/suzuki-shunsuke/github-comment \
--source-tag v6.2.1

Output:

Verified signature against tlog entry index 136872465 at URL: https://rekor.sigstore.dev/api/v1/log/entries/108e9186e8c5677a59e49ab5259899dbb7acf444257ae12b9bea6e420fb895ee3b8487181152cc54
Verified build using builder "https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@refs/tags/v2.0.0" at commit f204a947149fbbf2b33fa982c1af30b931b1aec2
Verifying artifact github-comment_6.2.1_darwin_arm64.tar.gz: PASSED

3. GitHub CLI

You can install GitHub CLI by aqua.

aqua g -i cli/cli
gh release download -R suzuki-shunsuke/github-comment v6.2.1 -p github-comment_6.2.1_darwin_arm64.tar.gz
gh attestation verify github-comment_6.2.1_darwin_arm64.tar.gz \
-R suzuki-shunsuke/github-comment \
--signer-workflow suzuki-shunsuke/go-release-workflow/.github/workflows/release.yaml

Output:

Loaded digest sha256:2cbad3938bc861a0a0069766226d05865c9365ad3e920bded1c1016c67b21051 for file://github-comment_6.2.1_darwin_arm64.tar.gz
Loaded 1 attestation from GitHub API
✓ Verification succeeded!

sha256:2cbad3938bc861a0a0069766226d05865c9365ad3e920bded1c1016c67b21051 was attested by:
REPO PREDICATE_TYPE WORKFLOW
suzuki-shunsuke/go-release-workflow https://slsa.dev/provenance/v1 .github/workflows/release.yaml@7f97a226912ee2978126019b1e95311d7d15c97a
- + \ No newline at end of file diff --git a/docs/search/index.html b/docs/search/index.html index 0a7dadf9..11a69a40 100644 --- a/docs/search/index.html +++ b/docs/search/index.html @@ -4,13 +4,13 @@ Search the documentation | github-comment - +

Search the documentation

- + \ No newline at end of file diff --git a/docs/usage/index.html b/docs/usage/index.html index 932e9cd9..d6a8c97c 100644 --- a/docs/usage/index.html +++ b/docs/usage/index.html @@ -4,13 +4,13 @@ Usage | github-comment - +

Usage

$ github-comment help
NAME:
github-comment - post a comment to GitHub

USAGE:
github-comment [global options] command [command options] [arguments...]

VERSION:
3.1.0

COMMANDS:
post post a comment
exec execute a command and post the result as a comment
init scaffold a configuration file if it doesn't exist
hide hide issue or pull request comments
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:
--log-level value log level [$GITHUB_COMMENT_LOG_LEVEL]
--help, -h show help (default: false)
--version, -v print the version (default: false)

post

$ github-comment help post
NAME:
github-comment post - post a comment

USAGE:
github-comment post [command options] [arguments...]

OPTIONS:
--org value GitHub organization name
--repo value GitHub repository name
--token value GitHub API token [$GITHUB_TOKEN, $GITHUB_ACCESS_TOKEN]
--sha1 value commit sha1
--template value comment template
--template-key value, -k value comment template key (default: "default")
--config value configuration file path
--pr value GitHub pull request number (default: 0)
--var value template variable
--var-file value template variable name and file path
--dry-run output a comment to standard error output instead of posting to GitHub (default: false)
--skip-no-token, -n works like dry-run if the GitHub Access Token isn't set (default: false) [$GITHUB_COMMENT_SKIP_NO_TOKEN]
--silent, -s suppress the output of dry-run and skip-no-token (default: false)
--stdin-template read standard input as the template (default: false)

exec

$ github-comment help exec
NAME:
github-comment exec - execute a command and post the result as a comment

USAGE:
github-comment exec [command options] [arguments...]

OPTIONS:
--org value GitHub organization name
--repo value GitHub repository name
--token value GitHub API token [$GITHUB_TOKEN, $GITHUB_ACCESS_TOKEN]
--sha1 value commit sha1
--template value comment template
--template-key value, -k value comment template key (default: "default")
--config value configuration file path
--pr value GitHub pull request number (default: 0)
--var value template variable
--var-file value template variable name and file path
--dry-run output a comment to standard error output instead of posting to GitHub (default: false)
--skip-no-token, -n works like dry-run if the GitHub Access Token isn't set (default: false) [$GITHUB_COMMENT_SKIP_NO_TOKEN]
--silent, -s suppress the output of dry-run and skip-no-token (default: false)

hide

$ github-comment help hide
NAME:
github-comment hide - hide issue or pull request comments

USAGE:
github-comment hide [command options] [arguments...]

OPTIONS:
--org value GitHub organization name
--repo value GitHub repository name
--token value GitHub API token [$GITHUB_TOKEN, $GITHUB_ACCESS_TOKEN]
--config value configuration file path
--condition value hide condition
--hide-key value, -k value hide condition key (default: "default")
--pr value GitHub pull request number (default: 0)
--sha1 value commit sha1
--var value template variable
--dry-run output a comment to standard error output instead of posting to GitHub (default: false)
--skip-no-token, -n works like dry-run if the GitHub Access Token isn't set (default: false) [$GITHUB_COMMENT_SKIP_NO_TOKEN]
--silent, -s suppress the output of dry-run and skip-no-token (default: false)
- + \ No newline at end of file