Compare commits

...

105 Commits
v1.4.4 ... main

Author SHA1 Message Date
Robert Kaussow e0a7273b31
add deprecation notice 2023-08-29 21:37:16 +02:00
renovate[bot] 7e2db33f5c chore(deps): update dependency golangci/golangci-lint to v1.54.2 2023-08-28 03:05:16 +00:00
renovate[bot] f1e1522576
fix(deps): update module github.com/urfave/cli/v2 to v2.25.7 (#233)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-17 15:37:01 +02:00
renovate[bot] 027021ac83
fix(deps): update module golang.org/x/oauth2 to v0.11.0 (#247)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-17 15:17:01 +02:00
renovate[bot] 259b75e63c
chore(docker): update golang:1.20 docker digest to 741d6f9 (#255)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-17 15:16:52 +02:00
renovate[bot] 5e43c2fe7b
fix(deps): update module github.com/google/go-github/v53 to v54 (#254)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-17 15:16:43 +02:00
renovate[bot] da319f5142 chore(docker): update golang:1.20 docker digest to ee18a70 2023-08-17 03:28:05 +00:00
renovate[bot] 5a62c8f9b8 chore(docker): update golang:1.20 docker digest to 2db0b25 2023-08-16 16:19:24 +00:00
renovate[bot] 8ce468a6a3 chore(deps): update dependency golangci/golangci-lint to v1.54.1 2023-08-14 04:58:51 +00:00
renovate[bot] 880ae9399c chore(docker): update golang:1.20 docker digest to 37c7d85 2023-08-10 03:45:18 +00:00
renovate[bot] 265a3f19e4 chore(docker): update alpine:3.18 docker digest to 7144f7b 2023-08-08 00:36:32 +00:00
renovate[bot] 8c260f5f48 chore(docker): update golang:1.20 docker digest to bc5f0b5 2023-08-02 03:13:21 +00:00
renovate[bot] 38c4bf31b2 chore(docker): update golang:1.20 docker digest to 010a0ff 2023-07-30 06:22:04 +00:00
renovate[bot] 04da18bb8c chore(docker): update golang:1.20 docker digest to cfc9d1b 2023-07-14 04:35:51 +00:00
renovate[bot] cd420cf43a chore(docker): update golang:1.20 docker digest to 8e5a006 2023-07-12 00:41:46 +00:00
renovate[bot] b576a57334
fix(deps): update module golang.org/x/oauth2 to v0.10.0 (#241)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-06 21:29:00 +02:00
renovate[bot] f36ea863ea chore(docker): update golang:1.20 docker digest to fd9306e 2023-07-06 04:13:01 +00:00
renovate[bot] 6f34c28032 chore(docker): update golang:1.20 docker digest to 20ee7c8 2023-07-05 13:41:16 +00:00
renovate[bot] a4ad4775f1 chore(docker): update golang:1.20 docker digest to ff2cca5 2023-07-05 07:23:28 +00:00
renovate[bot] fa3ab82c35 chore(docker): update golang:1.20 docker digest to 7954299 2023-07-05 01:31:43 +00:00
renovate[bot] 0d297a3ff7 chore(docker): update golang:1.20 docker digest to 344193a 2023-06-24 06:10:08 +00:00
renovate[bot] 67059dc9b0 chore(docker): update golang:1.20 docker digest to 8f958bf 2023-06-22 12:09:32 +00:00
renovate[bot] b984c8c5e6 chore(docker): update golang:1.20 docker digest to 9d0422f 2023-06-22 06:17:10 +00:00
renovate[bot] 7eac643e8e
fix(deps): update module github.com/google/go-github/v53 to v53.2.0 (#234)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-20 09:00:07 +02:00
renovate[bot] c4929dd69d chore(deps): update dependency golangci/golangci-lint to v1.53.3 2023-06-19 03:24:25 +00:00
renovate[bot] a2eb25c2f5 chore(docker): update docker digests 2023-06-18 08:14:29 +00:00
renovate[bot] 0fdb2cd171 chore(docker): update golang:1.20 docker digest to e7bb4d1 2023-06-14 16:11:35 +00:00
renovate[bot] 5f31a71b8a chore(docker): update golang:1.20 docker digest to 02d4d88 2023-06-14 00:10:38 +00:00
renovate[bot] 46a8078094
fix(deps): update module golang.org/x/oauth2 to v0.9.0 (#229)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-13 22:16:36 +02:00
renovate[bot] ff0b49b778
fix(deps): update module github.com/google/go-github/v53 to v53.1.0 (#227)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-13 15:02:35 +02:00
renovate[bot] 18ed34f026
fix(deps): update module github.com/google/go-github/v52 to v53 (#225)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-09 08:29:53 +02:00
renovate[bot] 5f3c5d935d chore(docker): update golang:1.20 docker digest to 4b1fc02 2023-06-07 00:25:17 +00:00
renovate[bot] 3ddc2342de
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.3.4 (#224)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-05 14:08:30 +02:00
renovate[bot] 1530352019
fix(deps): update module github.com/urfave/cli/v2 to v2.25.5 (#222)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-05 10:14:24 +02:00
renovate[bot] 819d6fa8f0
fix(deps): update module github.com/sirupsen/logrus to v1.9.3 (#221)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-05 10:00:14 +02:00
renovate[bot] 231b92cf6e
chore(deps): update dependency golangci/golangci-lint to v1.53.2 (#223)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2023-06-05 09:55:11 +02:00
renovate[bot] c39828de13
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.3.3 (#220)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-29 13:08:14 +02:00
renovate[bot] e10cd6a99f
fix(deps): update module github.com/urfave/cli/v2 to v2.25.4 (#219)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-29 11:39:35 +02:00
renovate[bot] 03be26c22f
chore(deps): update alpine docker tag to v3.18 (#214)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-28 15:27:30 +02:00
renovate[bot] 1872c9302c
fix(deps): update module github.com/sirupsen/logrus to v1.9.2 (#216)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-26 10:58:22 +02:00
renovate[bot] a15fd65fc6 chore(docker): update golang:1.20 docker digest to 690e413 2023-05-24 08:43:49 +00:00
renovate[bot] ac33b1c4f9 chore(docker): update golang:1.20 docker digest to 3f1f050 2023-05-24 00:02:17 +00:00
renovate[bot] 0c5aa0cc86
fix(deps): update module github.com/urfave/cli/v2 to v2.25.3 (#212)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-14 18:54:20 +02:00
renovate[bot] 53dcbf7143
fix(deps): update module golang.org/x/oauth2 to v0.8.0 (#213)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-13 11:13:33 +02:00
renovate[bot] 5b634dd101 chore(docker): update golang:1.20 docker digest to 685a22e 2023-05-10 07:54:59 +00:00
renovate[bot] 50fb025d62 chore(docker): update golang:1.20 docker digest to 31a8f92 2023-05-05 08:22:57 +00:00
renovate[bot] 73b6585e99 chore(docker): update golang:1.20 docker digest to 4dd688d 2023-05-05 00:09:20 +00:00
renovate[bot] a7bdea7405 chore(docker): update golang:1.20 docker digest to 3b2c96d 2023-05-04 16:44:16 +00:00
renovate[bot] bd5a92ddc5 chore(docker): update golang:1.20 docker digest to 6876eff 2023-05-04 04:36:26 +00:00
Robert Kaussow 3efa2643f2
fix bare url in contribution file (#208) 2023-05-03 11:50:02 +02:00
renovate[bot] b682ed35b8
fix(deps): update module github.com/google/go-github/v51 to v52 (#206)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-25 09:51:44 +02:00
renovate[bot] d71cb8ab92 chore(deps): update dependency mvdan/gofumpt to v0.5.0 2023-04-17 02:40:07 +00:00
renovate[bot] 544b68b1b8
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.3.2 (#204)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-14 23:26:13 +02:00
renovate[bot] 6c6b48f355
fix(deps): update module github.com/urfave/cli/v2 to v2.25.1 (#197)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-14 09:00:34 +02:00
renovate[bot] 7856bee18e
fix(deps): update module golang.org/x/oauth2 to v0.7.0 (#202)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-14 08:47:56 +02:00
renovate[bot] 394ceed685 chore(docker): update golang:1.20 docker digest to 403f486 2023-04-13 12:34:57 +00:00
renovate[bot] 45a6bfb25e
fix(deps): update module github.com/google/go-github/v50 to v51 (#201)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-06 09:48:46 +02:00
renovate[bot] 5b2da39318 chore(docker): update golang:1.20 docker digest to 23050c2 2023-04-05 01:43:59 +00:00
renovate[bot] aad680a111 chore(docker): update alpine:3.17 docker digest to 124c7d2 2023-03-30 00:26:10 +00:00
renovate[bot] 2d66ab4fb7 chore(docker): update golang:1.20 docker digest to f709934 2023-03-28 00:37:32 +00:00
renovate[bot] 827c907c96 chore(deps): update dependency golangci/golangci-lint to v1.52.2 2023-03-27 01:40:57 +00:00
renovate[bot] 5322f0d996 chore(docker): update golang:1.20 docker digest to 1724dc3 2023-03-25 09:28:16 +00:00
renovate[bot] 8bab936e76 chore(docker): update golang:1.20 docker digest to 80950aa 2023-03-24 08:58:59 +00:00
renovate[bot] a7bf8a604c chore(docker): update golang:1.20 docker digest to 41a6cb5 2023-03-24 05:12:06 +00:00
renovate[bot] 1c57a0111f chore(docker): update golang:1.20 docker digest to 8114f4a 2023-03-24 01:35:21 +00:00
renovate[bot] f656876298 chore(docker): update golang:1.20 docker digest to a13b5e3 2023-03-23 20:44:31 +00:00
renovate[bot] 4c1360f975
fix(deps): update module github.com/google/go-github/v50 to v50.2.0 (#188) 2023-03-20 09:36:28 +01:00
renovate[bot] 178bebe5d0 chore(deps): update dependency golangci/golangci-lint to v1.52.0 2023-03-20 03:37:43 +00:00
renovate[bot] cdc6fc9cea chore(docker): update golang:1.20 docker digest to 5990c4f 2023-03-16 19:52:11 +00:00
renovate[bot] 8a4451990e chore(docker): update alpine:3.17 docker digest to ff6bdca 2023-03-14 00:30:18 +00:00
renovate[bot] 438c140f9a
fix(deps): update module golang.org/x/oauth2 to v0.6.0 (#182) 2023-03-09 20:48:51 +01:00
renovate[bot] af8eac444e chore(docker): update golang:1.20 docker digest to 74a3829 2023-03-08 05:53:43 +00:00
renovate[bot] 7c61dbfc51 chore(docker): update golang:1.20 docker digest to 52921e6 2023-03-02 11:10:34 +00:00
renovate[bot] cb65f5379b chore(docker): update golang:1.20 docker digest to a83a6a3 2023-03-01 17:40:42 +00:00
renovate[bot] b015e9c82a chore(deps): update dependency golangci/golangci-lint to v1.51.2 2023-02-27 05:41:27 +00:00
renovate[bot] 1c2e7a3e04
fix(deps): update module github.com/urfave/cli/v2 to v2.24.4 (#178) 2023-02-25 16:14:17 +01:00
dependabot[bot] 96e4edada0
chore(deps): bump golang.org/x/net from 0.6.0 to 0.7.0 (#177) 2023-02-25 15:19:59 +01:00
renovate[bot] 7b195daa1c
fix(deps): update module github.com/google/go-github/v50 to v50.1.0 (#176) 2023-02-24 22:30:32 +01:00
renovate[bot] fdcd30d7e0 chore(docker): update golang:1.20 docker digest to 2edf6aa 2023-02-16 08:21:21 +00:00
renovate[bot] 75e5bfd055 chore(docker): update golang:1.20 docker digest to 9911e93 2023-02-15 06:14:41 +00:00
renovate[bot] e67f8dec0e
fix(deps): update module golang.org/x/oauth2 to v0.5.0 (#171) 2023-02-12 14:51:06 +01:00
renovate[bot] 64ff3f55c9 chore(docker): update docker digests 2023-02-11 09:15:49 +00:00
renovate[bot] 6dedd490a8 chore(docker): update golang:1.20 docker digest to 53b7958 2023-02-10 06:30:01 +00:00
Robert Kaussow 1c7f0d8f0d
ci: bump container build plugin to drone-docker-buildx:23 (#170) 2023-02-09 08:54:10 +01:00
renovate[bot] 486dd5239f
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.3.1 (#169) 2023-02-08 17:18:32 +01:00
Robert Kaussow 8403ebbec9
fix drone-matrix template 2023-02-08 17:04:28 +01:00
renovate[bot] 1fd7dbb74a
fix(deps): update module github.com/joho/godotenv to v1.5.1 (#162) 2023-02-08 11:07:22 +01:00
renovate[bot] 3ac07c1959
chore(deps): update golang docker tag to v1.20 (#161) 2023-02-08 10:22:35 +01:00
Robert Kaussow c5514b1d3b
refactor: add more linters and fix findings (#168) 2023-02-08 10:13:43 +01:00
renovate[bot] a02b3b3fbc chore(deps): update dependency golangci/golangci-lint to v1.51.1 2023-02-06 06:17:52 +00:00
renovate[bot] cffedd2120 chore(docker): update golang:1.19 docker digest to 09009d4 2023-02-05 15:44:56 +00:00
renovate[bot] a3db84f019 chore(docker): update golang:1.19 docker digest to 0ff9c06 2023-02-05 10:49:11 +00:00
renovate[bot] b09a1c1dfd chore(docker): update golang:1.19 docker digest to 101204a 2023-02-05 04:32:21 +00:00
renovate[bot] ac1d94b5fc chore(docker): update golang:1.19 docker digest to 9e577b0 2023-02-04 16:45:27 +00:00
renovate[bot] bbe2971eed
fix(deps): update module github.com/urfave/cli/v2 to v2.24.3 (#159) 2023-02-03 08:48:17 +01:00
renovate[bot] 7505d22304
fix(deps): update module github.com/google/go-github/v49 to v50 (#160) 2023-02-02 09:18:13 +01:00
renovate[bot] 38428e0486
fix(deps): update module github.com/google/go-github/v49 to v49.1.0 (#155) 2023-01-15 21:53:18 +01:00
Robert Kaussow 3481478523
ci: replace outdated gh-pages plugin (#158) 2023-01-14 23:21:04 +01:00
Robert Kaussow 43f0af1403
unify makefile syntax (#157) 2023-01-14 22:57:30 +01:00
Robert Kaussow ff90746361
refactor: use buildx for multiarch container builds (#156) 2023-01-14 22:42:00 +01:00
renovate[bot] 27823bd86a chore(docker): update docker digests 2023-01-10 00:37:09 +00:00
Robert Kaussow ed0d8e66a9
ci: switch to buildx plugin (#153) 2023-01-08 15:40:10 +01:00
renovate[bot] e332141d66
fix(deps): update module github.com/google/go-github/v48 to v49 (#150) 2023-01-08 15:13:32 +01:00
renovate[bot] ae4a4020ef
fix(deps): update module golang.org/x/oauth2 to v0.4.0 (#151) 2023-01-08 15:13:12 +01:00
Robert Kaussow 10473b8ae7
BREAKING CHANGE: remove support for arm32 (#152) 2023-01-08 15:04:54 +01:00
21 changed files with 197 additions and 974 deletions

View File

@ -1,2 +0,0 @@
*
!dist/

View File

@ -1,352 +0,0 @@
local PipelineTest = {
kind: 'pipeline',
name: 'test',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'deps',
image: 'golang:1.19',
commands: [
'make deps',
],
volumes: [
{
name: 'godeps',
path: '/go',
},
],
},
{
name: 'lint',
image: 'golang:1.19',
commands: [
'make lint',
],
volumes: [
{
name: 'godeps',
path: '/go',
},
],
},
{
name: 'test',
image: 'golang:1.19',
commands: [
'make test',
],
volumes: [
{
name: 'godeps',
path: '/go',
},
],
},
],
volumes: [
{
name: 'godeps',
temp: {},
},
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
local PipelineBuildBinaries = {
kind: 'pipeline',
name: 'build-binaries',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'build',
image: 'techknowlogick/xgo:go-1.19.x',
commands: [
'ln -s /drone/src /source',
'make release',
],
},
{
name: 'executable',
image: 'alpine',
commands: [
'$(find dist/ -executable -type f -iname ${DRONE_REPO_NAME}-linux-amd64) --help',
],
},
{
name: 'changelog-generate',
image: 'thegeeklab/git-chglog',
commands: [
'git fetch -tq',
'git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}',
],
},
{
name: 'changelog-format',
image: 'thegeeklab/alpine-tools',
commands: [
'prettier CHANGELOG.md',
'prettier -w CHANGELOG.md',
],
},
{
name: 'publish',
image: 'plugins/github-release',
settings: {
overwrite: true,
api_key: {
from_secret: 'github_token',
},
files: ['dist/*'],
title: '${DRONE_TAG}',
note: 'CHANGELOG.md',
},
when: {
ref: [
'refs/tags/**',
],
},
},
],
depends_on: [
'test',
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
local PipelineBuildContainer(arch='amd64') = {
kind: 'pipeline',
name: 'build-container-' + arch,
platform: {
os: 'linux',
arch: arch,
},
steps: [
{
name: 'build',
image: 'golang:1.19',
commands: [
'make build',
'ls -l dist/drone-github-comment',
],
},
{
name: 'dryrun',
image: 'thegeeklab/drone-docker:19',
settings: {
dry_run: true,
dockerfile: 'docker/Dockerfile.' + arch,
repo: 'thegeeklab/${DRONE_REPO_NAME}',
},
depends_on: ['build'],
when: {
ref: ['refs/pull/**'],
},
},
{
name: 'publish-dockerhub',
image: 'thegeeklab/drone-docker:19',
settings: {
auto_tag: true,
auto_tag_suffix: arch,
dockerfile: 'docker/Dockerfile.' + arch,
repo: 'thegeeklab/${DRONE_REPO_NAME}',
username: { from_secret: 'docker_username' },
password: { from_secret: 'docker_password' },
},
when: {
ref: ['refs/heads/main', 'refs/tags/**'],
},
depends_on: ['dryrun'],
},
{
name: 'publish-quay',
image: 'thegeeklab/drone-docker:19',
settings: {
auto_tag: true,
auto_tag_suffix: arch,
dockerfile: 'docker/Dockerfile.' + arch,
registry: 'quay.io',
repo: 'quay.io/thegeeklab/${DRONE_REPO_NAME}',
username: { from_secret: 'quay_username' },
password: { from_secret: 'quay_password' },
},
when: {
ref: ['refs/heads/main', 'refs/tags/**'],
},
depends_on: ['dryrun'],
},
],
depends_on: [
'test',
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
local PipelineDocs = {
kind: 'pipeline',
name: 'docs',
platform: {
os: 'linux',
arch: 'amd64',
},
concurrency: {
limit: 1,
},
steps: [
{
name: 'markdownlint',
image: 'thegeeklab/markdownlint-cli',
commands: [
"markdownlint 'docs/content/**/*.md' 'README.md' 'CONTRIBUTING.md'",
],
},
{
name: 'spellcheck',
image: 'thegeeklab/alpine-tools',
commands: [
"spellchecker --files '_docs/**/*.md' 'README.md' 'CONTRIBUTING.md' -d .dictionary -p spell indefinite-article syntax-urls --no-suggestions",
],
environment: {
FORCE_COLOR: true,
NPM_CONFIG_LOGLEVEL: 'error',
},
},
{
name: 'publish',
image: 'plugins/gh-pages',
settings: {
username: { from_secret: 'github_username' },
password: { from_secret: 'github_token' },
pages_directory: '_docs/',
target_branch: 'docs',
},
when: {
ref: ['refs/heads/main'],
},
},
],
depends_on: [
'build-binaries',
'build-container-amd64',
'build-container-arm64',
'build-container-arm',
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
local PipelineNotifications = {
kind: 'pipeline',
name: 'notifications',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
image: 'plugins/manifest',
name: 'manifest-dockerhub',
settings: {
ignore_missing: true,
auto_tag: true,
username: { from_secret: 'docker_username' },
password: { from_secret: 'docker_password' },
spec: 'docker/manifest.tmpl',
},
when: {
status: ['success'],
},
},
{
image: 'plugins/manifest',
name: 'manifest-quay',
settings: {
ignore_missing: true,
auto_tag: true,
username: { from_secret: 'quay_username' },
password: { from_secret: 'quay_password' },
spec: 'docker/manifest-quay.tmpl',
},
when: {
status: ['success'],
},
},
{
name: 'pushrm-dockerhub',
image: 'chko/docker-pushrm:1',
environment: {
DOCKER_PASS: {
from_secret: 'docker_password',
},
DOCKER_USER: {
from_secret: 'docker_username',
},
PUSHRM_FILE: 'README.md',
PUSHRM_SHORT: 'Drone plugin to add comments to GitHub Issues and Pull Requests',
PUSHRM_TARGET: 'thegeeklab/${DRONE_REPO_NAME}',
},
when: {
status: ['success'],
},
},
{
name: 'pushrm-quay',
image: 'chko/docker-pushrm:1',
environment: {
APIKEY__QUAY_IO: {
from_secret: 'quay_token',
},
PUSHRM_FILE: 'README.md',
PUSHRM_TARGET: 'quay.io/thegeeklab/${DRONE_REPO_NAME}',
},
when: {
status: ['success'],
},
},
{
name: 'matrix',
image: 'thegeeklab/drone-matrix',
settings: {
homeserver: { from_secret: 'matrix_homeserver' },
roomid: { from_secret: 'matrix_roomid' },
template: 'Status: **{{ build.Status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}){{#if build.Branch}} ({{ build.Branch }}){{/if}} by {{ commit.Author }}<br/> Message: {{ commit.Message.Title }}',
username: { from_secret: 'matrix_username' },
password: { from_secret: 'matrix_password' },
},
when: {
status: ['success', 'failure'],
},
},
],
depends_on: [
'docs',
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**'],
status: ['success', 'failure'],
},
};
[
PipelineTest,
PipelineBuildBinaries,
PipelineBuildContainer(arch='amd64'),
PipelineBuildContainer(arch='arm64'),
PipelineBuildContainer(arch='arm'),
PipelineDocs,
PipelineNotifications,
]

View File

@ -1,462 +0,0 @@
---
kind: pipeline
name: test
platform:
os: linux
arch: amd64
steps:
- name: deps
image: golang:1.19
commands:
- make deps
volumes:
- name: godeps
path: /go
- name: lint
image: golang:1.19
commands:
- make lint
volumes:
- name: godeps
path: /go
- name: test
image: golang:1.19
commands:
- make test
volumes:
- name: godeps
path: /go
volumes:
- name: godeps
temp: {}
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
---
kind: pipeline
name: build-binaries
platform:
os: linux
arch: amd64
steps:
- name: build
image: techknowlogick/xgo:go-1.19.x
commands:
- ln -s /drone/src /source
- make release
- name: executable
image: alpine
commands:
- $(find dist/ -executable -type f -iname ${DRONE_REPO_NAME}-linux-amd64) --help
- name: changelog-generate
image: thegeeklab/git-chglog
commands:
- git fetch -tq
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
- name: changelog-format
image: thegeeklab/alpine-tools
commands:
- prettier CHANGELOG.md
- prettier -w CHANGELOG.md
- name: publish
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files:
- dist/*
note: CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
ref:
- refs/tags/**
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: build-container-amd64
platform:
os: linux
arch: amd64
steps:
- name: build
image: golang:1.19
commands:
- make build
- ls -l dist/drone-github-comment
- name: dryrun
image: thegeeklab/drone-docker:19
settings:
dockerfile: docker/Dockerfile.amd64
dry_run: true
repo: thegeeklab/${DRONE_REPO_NAME}
when:
ref:
- refs/pull/**
depends_on:
- build
- name: publish-dockerhub
image: thegeeklab/drone-docker:19
settings:
auto_tag: true
auto_tag_suffix: amd64
dockerfile: docker/Dockerfile.amd64
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
- name: publish-quay
image: thegeeklab/drone-docker:19
settings:
auto_tag: true
auto_tag_suffix: amd64
dockerfile: docker/Dockerfile.amd64
password:
from_secret: quay_password
registry: quay.io
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: build-container-arm64
platform:
os: linux
arch: arm64
steps:
- name: build
image: golang:1.19
commands:
- make build
- ls -l dist/drone-github-comment
- name: dryrun
image: thegeeklab/drone-docker:19
settings:
dockerfile: docker/Dockerfile.arm64
dry_run: true
repo: thegeeklab/${DRONE_REPO_NAME}
when:
ref:
- refs/pull/**
depends_on:
- build
- name: publish-dockerhub
image: thegeeklab/drone-docker:19
settings:
auto_tag: true
auto_tag_suffix: arm64
dockerfile: docker/Dockerfile.arm64
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
- name: publish-quay
image: thegeeklab/drone-docker:19
settings:
auto_tag: true
auto_tag_suffix: arm64
dockerfile: docker/Dockerfile.arm64
password:
from_secret: quay_password
registry: quay.io
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: build-container-arm
platform:
os: linux
arch: arm
steps:
- name: build
image: golang:1.19
commands:
- make build
- ls -l dist/drone-github-comment
- name: dryrun
image: thegeeklab/drone-docker:19
settings:
dockerfile: docker/Dockerfile.arm
dry_run: true
repo: thegeeklab/${DRONE_REPO_NAME}
when:
ref:
- refs/pull/**
depends_on:
- build
- name: publish-dockerhub
image: thegeeklab/drone-docker:19
settings:
auto_tag: true
auto_tag_suffix: arm
dockerfile: docker/Dockerfile.arm
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
- name: publish-quay
image: thegeeklab/drone-docker:19
settings:
auto_tag: true
auto_tag_suffix: arm
dockerfile: docker/Dockerfile.arm
password:
from_secret: quay_password
registry: quay.io
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: docs
platform:
os: linux
arch: amd64
concurrency:
limit: 1
steps:
- name: markdownlint
image: thegeeklab/markdownlint-cli
commands:
- markdownlint 'docs/content/**/*.md' 'README.md' 'CONTRIBUTING.md'
- name: spellcheck
image: thegeeklab/alpine-tools
commands:
- spellchecker --files '_docs/**/*.md' 'README.md' 'CONTRIBUTING.md' -d .dictionary -p spell indefinite-article syntax-urls --no-suggestions
environment:
FORCE_COLOR: true
NPM_CONFIG_LOGLEVEL: error
- name: publish
image: plugins/gh-pages
settings:
pages_directory: _docs/
password:
from_secret: github_token
target_branch: docs
username:
from_secret: github_username
when:
ref:
- refs/heads/main
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- build-binaries
- build-container-amd64
- build-container-arm64
- build-container-arm
---
kind: pipeline
name: notifications
platform:
os: linux
arch: amd64
steps:
- name: manifest-dockerhub
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/manifest.tmpl
username:
from_secret: docker_username
when:
status:
- success
- name: manifest-quay
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: quay_password
spec: docker/manifest-quay.tmpl
username:
from_secret: quay_username
when:
status:
- success
- name: pushrm-dockerhub
image: chko/docker-pushrm:1
environment:
DOCKER_PASS:
from_secret: docker_password
DOCKER_USER:
from_secret: docker_username
PUSHRM_FILE: README.md
PUSHRM_SHORT: Drone plugin to add comments to GitHub Issues and Pull Requests
PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME}
when:
status:
- success
- name: pushrm-quay
image: chko/docker-pushrm:1
environment:
APIKEY__QUAY_IO:
from_secret: quay_token
PUSHRM_FILE: README.md
PUSHRM_TARGET: quay.io/thegeeklab/${DRONE_REPO_NAME}
when:
status:
- success
- name: matrix
image: thegeeklab/drone-matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
roomid:
from_secret: matrix_roomid
template: "Status: **{{ build.Status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}){{#if build.Branch}} ({{ build.Branch }}){{/if}} by {{ commit.Author }}<br/> Message: {{ commit.Message.Title }}"
username:
from_secret: matrix_username
when:
status:
- success
- failure
trigger:
ref:
- refs/heads/main
- refs/tags/**
status:
- success
- failure
depends_on:
- docs
---
kind: signature
hmac: ca0b33b5e34155aaf1edb9bb442c51b2d4c2fe617f8fc08a65ac13a86904211c
...

View File

@ -1,25 +1,91 @@
linters:
enable:
- gosimple
- deadcode
- typecheck
- govet
- errcheck
- staticcheck
- unused
- structcheck
- varcheck
- dupl
- gofmt
- misspell
- gocritic
- bidichk
- ineffassign
- revive
- gofumpt
- depguard
enable-all: false
disable-all: true
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- decorder
- dogsled
- dupl
- dupword
- durationcheck
- errchkjson
- errname
- errorlint
- execinquery
- exhaustive
- exportloopref
- forcetypeassert
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- goerr113
- gofmt
- gofumpt
- goheader
- goimports
- gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- grouper
- importas
- interfacebloat
- ireturn
- lll
- loggercheck
- maintidx
- makezero
- misspell
- musttag
- nakedret
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
- nonamedreturns
- nosprintfhostport
- prealloc
- predeclared
- promlinter
- reassign
- revive
# - rowserrcheck
# - sqlclosecheck
# - structcheck
- stylecheck
- tagliatelle
- tenv
- testableexamples
- thelper
- tparallel
- unconvert
- unparam
- usestdlibvars
# - wastedassign
- whitespace
- wsl
fast: false
run:
@ -28,4 +94,4 @@ run:
linters-settings:
gofumpt:
extra-rules: true
lang-version: "1.18"
lang-version: "1.20"

View File

@ -3,7 +3,7 @@
## Security
If you think you have found a **security issue**, please do not mention it in this repository.
Instead, send an email to security@thegeeklab.de with as many details as possible so it can be handled confidential.
Instead, send an email to `security@thegeeklab.de` with as many details as possible so it can be handled confidential.
## Bug Reports and Feature Requests

View File

@ -1,4 +1,14 @@
FROM arm32v7/alpine:3.17@sha256:4c679bd1e6b6516faf8466986fc2a9f52496e61cada7c29ec746621a954a80ac
FROM --platform=$BUILDPLATFORM golang:1.20@sha256:741d6f9bcab778441efe05c8e4369d4f8ff56c9a635a97d77f55d8b0ec62f907 as build
ARG TARGETOS
ARG TARGETARCH
ADD . /src
WORKDIR /src
RUN make build
FROM alpine:3.18@sha256:7144f7bab3d4c2648d7e59409f15ec52a18006a128c733fcff20d3a4a54ba44a
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
@ -7,6 +17,5 @@ LABEL org.opencontainers.image.url="https://github.com/thegeeklab/drone-github-c
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/drone-github-comment"
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/drone-github-comment"
ADD dist/drone-github-comment /bin/
COPY --from=build /src/dist/drone-github-comment /bin/drone-github-comment
ENTRYPOINT ["/bin/drone-github-comment"]

View File

@ -1,7 +1,7 @@
# renovate: datasource=github-releases depName=mvdan/gofumpt
GOFUMPT_PACKAGE_VERSION := v0.4.0
GOFUMPT_PACKAGE_VERSION := v0.5.0
# renovate: datasource=github-releases depName=golangci/golangci-lint
GOLANGCI_LINT_PACKAGE_VERSION := v1.50.1
GOLANGCI_LINT_PACKAGE_VERSION := v1.54.2
EXECUTABLE := drone-github-comment
@ -19,9 +19,14 @@ GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@$(G
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GENERATE ?=
XGO_VERSION := go-1.19.x
XGO_VERSION := go-1.20.x
XGO_TARGETS ?= linux/amd64,linux/arm-6,linux/arm-7,linux/arm64
TARGETOS ?= linux
TARGETARCH ?= amd64
ifneq ("$(TARGETVARIANT)","")
GOARM ?= $(subst v,,$(TARGETVARIANT))
endif
TAGS ?= netgo
ifndef VERSION
@ -69,7 +74,7 @@ test:
build: $(DIST)/$(EXECUTABLE)
$(DIST)/$(EXECUTABLE): $(SOURCES)
$(GO) build -v -tags '$(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -o $@ ./cmd/$(EXECUTABLE)
GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) GOARM=$(GOARM) $(GO) build -v -tags '$(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -o $@ ./cmd/$(EXECUTABLE)
$(DIST_DIRS):
mkdir -p $(DIST_DIRS)

View File

@ -1,6 +1,6 @@
# drone-github-comment
Drone plugin to add comments to GitHub Issues and Pull Requests
DISCONTINUED: Drone plugin to add comments to GitHub Issues and Pull Requests
[![Build Status](https://img.shields.io/drone/build/thegeeklab/drone-github-comment?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/drone-github-comment)
[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/drone-github-comment)
@ -10,6 +10,8 @@ Drone plugin to add comments to GitHub Issues and Pull Requests
[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/drone-github-comment)
[![License: MIT](https://img.shields.io/github/license/thegeeklab/drone-github-comment)](https://github.com/thegeeklab/drone-github-comment/blob/main/LICENSE)
> **DISCONTINUED:** As I don't use Drone CI anymore, this project is unmaintained. If you are interested in a free and open source CI system check out [Woodpecker CI](https://woodpecker-ci.org/).
Drone plugin to add comments to GitHub Issues and Pull Requests. You can find the full documentation at [https://drone-plugin-index.geekdocs.de](https://drone-plugin-index.geekdocs.de/plugins/drone-github-comment).
## Contributors

View File

@ -19,6 +19,10 @@ Drone plugin to add comments to GitHub Issues and Pull Requests.
## Usage
{{< hint type=note >}}
Only pull request events are supported by this plugin. Running the plugin on other events will result in an error.
{{< /hint >}}
```YAML
kind: pipeline
name: default

View File

@ -11,6 +11,7 @@ import (
"github.com/urfave/cli/v2"
)
//nolint:gochecknoglobals
var (
BuildVersion = "devel"
BuildDate = "00000000"

View File

@ -1,12 +0,0 @@
FROM alpine:3.17@sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.title="drone-github-comment"
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/drone-github-comment"
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/drone-github-comment"
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/drone-github-comment"
ADD dist/drone-github-comment /bin/
ENTRYPOINT ["/bin/drone-github-comment"]

View File

@ -1,12 +0,0 @@
FROM arm64v8/alpine:3.17@sha256:af06af3514c44a964d3b905b498cf6493db8f1cde7c10e078213a89c87308ba0
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.title="drone-github-comment"
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/drone-github-comment"
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/drone-github-comment"
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/drone-github-comment"
ADD dist/drone-github-comment /bin/
ENTRYPOINT ["/bin/drone-github-comment"]

View File

@ -1,24 +0,0 @@
image: quay.io/thegeeklab/drone-github-comment:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
- image: quay.io/thegeeklab/drone-github-comment:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64
platform:
architecture: amd64
os: linux
- image: quay.io/thegeeklab/drone-github-comment:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64
platform:
architecture: arm64
os: linux
variant: v8
- image: quay.io/thegeeklab/drone-github-comment:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm
platform:
architecture: arm
os: linux
variant: v7

View File

@ -1,24 +0,0 @@
image: thegeeklab/drone-github-comment:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
- image: thegeeklab/drone-github-comment:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64
platform:
architecture: amd64
os: linux
- image: thegeeklab/drone-github-comment:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64
platform:
architecture: arm64
os: linux
variant: v8
- image: thegeeklab/drone-github-comment:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm
platform:
architecture: arm
os: linux
variant: v7

26
go.mod
View File

@ -1,25 +1,27 @@
module github.com/thegeeklab/drone-github-comment
go 1.19
go 1.20
require (
github.com/google/go-github/v48 v48.2.0
github.com/joho/godotenv v1.4.0
github.com/sirupsen/logrus v1.9.0
github.com/thegeeklab/drone-plugin-lib/v2 v2.2.1
github.com/urfave/cli/v2 v2.23.7
golang.org/x/oauth2 v0.3.0
github.com/google/go-github/v54 v54.0.0
github.com/joho/godotenv v1.5.1
github.com/sirupsen/logrus v1.9.3
github.com/thegeeklab/drone-plugin-lib/v2 v2.3.4
github.com/urfave/cli/v2 v2.25.7
golang.org/x/oauth2 v0.11.0
)
require (
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 // indirect
golang.org/x/net v0.3.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/sys v0.11.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
)

57
go.sum
View File

@ -1,3 +1,9 @@
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA=
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g=
github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I=
github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -5,54 +11,61 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-github/v48 v48.2.0 h1:68puzySE6WqUY9KWmpOsDEQfDZsso98rT6pZcz9HqcE=
github.com/google/go-github/v48 v48.2.0/go.mod h1:dDlehKBDo850ZPvCTK0sEqTCVWcrGl2LcDiajkYi89Y=
github.com/google/go-github/v54 v54.0.0 h1:OZdXwow4EAD5jEo5qg+dGFH2DpkyZvVsAehjvJuUL/c=
github.com/google/go-github/v54 v54.0.0/go.mod h1:Sw1LXWHhXRZtzJ9LI5fyJg9wbQzYvFhW8W5P2yaAQ7s=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg=
github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/thegeeklab/drone-plugin-lib/v2 v2.2.1 h1:fta32M+y6aHG/BX+Kwxo9DQAcYpTyCBHn7sAm2qjfL0=
github.com/thegeeklab/drone-plugin-lib/v2 v2.2.1/go.mod h1:Bu++VS6GXEWCHQdzR65dPsGtBGOMuqAQPiRVBaa+HrY=
github.com/urfave/cli/v2 v2.23.7 h1:YHDQ46s3VghFHFf1DdF+Sh7H4RqhcM+t0TmZRJx4oJY=
github.com/urfave/cli/v2 v2.23.7/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
github.com/thegeeklab/drone-plugin-lib/v2 v2.3.4 h1:Quzrike/xRAR0izxQ0d+ocJyIUm4h1497Oyo9grcRzg=
github.com/thegeeklab/drone-plugin-lib/v2 v2.3.4/go.mod h1:qWVUZCmwL0Ntwa/hvyqM03EeIr1ReBR2XJsmIc7MGus=
github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs=
github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 h1:S25/rfnfsMVgORT4/J61MJ7rdyseOZOyvLIrZEZ7s6s=
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk=
golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8=
golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU=
golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

View File

@ -5,7 +5,7 @@ import (
"fmt"
"strings"
"github.com/google/go-github/v48/github"
"github.com/google/go-github/v54/github"
)
// Release holds ties the drone env data and github client together.
@ -18,32 +18,33 @@ type commentClient struct {
IssueNum int
*github.Client
context.Context
}
func (cc *commentClient) issueComment() error {
var err error
var comment *github.IssueComment
var resp *github.Response
func (cc *commentClient) issueComment(ctx context.Context) error {
var (
err error
comment *github.IssueComment
resp *github.Response
)
ic := &github.IssueComment{
issueComment := &github.IssueComment{
Body: &cc.Message,
}
if cc.Update {
// Append plugin comment ID to comment message so we can search for it later
message := fmt.Sprintf("%s\n<!-- id: %s -->\n", cc.Message, cc.Key)
ic.Body = &message
issueComment.Body = &message
comment, err = cc.comment()
comment, err = cc.comment(ctx)
if err == nil && comment != nil {
_, resp, err = cc.Client.Issues.EditComment(cc.Context, cc.Owner, cc.Repo, int64(*comment.ID), ic)
_, resp, err = cc.Client.Issues.EditComment(ctx, cc.Owner, cc.Repo, *comment.ID, issueComment)
}
}
if err == nil && resp == nil {
_, _, err = cc.Client.Issues.CreateComment(cc.Context, cc.Owner, cc.Repo, cc.IssueNum, ic)
_, _, err = cc.Client.Issues.CreateComment(ctx, cc.Owner, cc.Repo, cc.IssueNum, issueComment)
}
if err != nil {
@ -53,21 +54,23 @@ func (cc *commentClient) issueComment() error {
return nil
}
func (cc *commentClient) comment() (*github.IssueComment, error) {
func (cc *commentClient) comment(ctx context.Context) (*github.IssueComment, error) {
var allComments []*github.IssueComment
opts := &github.IssueListCommentsOptions{}
for {
comments, resp, err := cc.Client.Issues.ListComments(cc.Context, cc.Owner, cc.Repo, cc.IssueNum, opts)
comments, resp, err := cc.Client.Issues.ListComments(ctx, cc.Owner, cc.Repo, cc.IssueNum, opts)
if err != nil {
return nil, err
}
allComments = append(allComments, comments...)
if resp.NextPage == 0 {
break
}
opts.Page = resp.NextPage
}
@ -77,5 +80,6 @@ func (cc *commentClient) comment() (*github.IssueComment, error) {
}
}
//nolint:nilnil
return nil, nil
}

View File

@ -3,11 +3,12 @@ package plugin
import (
"context"
"crypto/sha256"
"errors"
"fmt"
"net/url"
"strings"
"github.com/google/go-github/v48/github"
"github.com/google/go-github/v54/github"
"github.com/sirupsen/logrus"
"golang.org/x/oauth2"
)
@ -26,12 +27,14 @@ type Settings struct {
baseURL *url.URL
}
var ErrPluginEventNotSupported = errors.New("event not supported")
// Validate handles the settings validation of the plugin.
func (p *Plugin) Validate() error {
var err error
if p.pipeline.Build.Event != "pull_request" {
return fmt.Errorf("github comment plugin is only available for pull requests")
return fmt.Errorf("%w: %s", ErrPluginEventNotSupported, p.pipeline.Build.Event)
}
if p.settings.Message != "" {
@ -43,6 +46,7 @@ func (p *Plugin) Validate() error {
if !strings.HasSuffix(p.settings.BaseURL, "/") {
p.settings.BaseURL += "/"
}
p.settings.baseURL, err = url.Parse(p.settings.BaseURL)
if err != nil {
return fmt.Errorf("failed to parse base url: %w", err)
@ -53,6 +57,7 @@ func (p *Plugin) Validate() error {
hash := sha256.Sum256([]byte(key))
p.settings.Key = fmt.Sprintf("%x", hash)
}
if p.settings.Key, _, err = readStringOrFile(p.settings.Key); err != nil {
return fmt.Errorf("error while reading %s: %w", p.settings.Key, err)
}
@ -71,9 +76,8 @@ func (p *Plugin) Execute() error {
client := github.NewClient(tc)
client.BaseURL = p.settings.baseURL
cc := commentClient{
commentClient := commentClient{
Client: client,
Context: p.network.Context,
Repo: p.pipeline.Repo.Name,
Owner: p.pipeline.Repo.Owner,
Message: p.settings.Message,
@ -84,10 +88,11 @@ func (p *Plugin) Execute() error {
if p.settings.SkipMissing && !p.settings.IsFile {
logrus.Infof("comment skipped: 'message' is not a valid path or file does not exist while 'skip-missing' is enabled")
return nil
}
err := cc.issueComment()
err := commentClient.issueComment(p.network.Context)
if err != nil {
return fmt.Errorf("failed to create or update comment: %w", err)
}

View File

@ -12,7 +12,7 @@ type Plugin struct {
}
// New initializes a plugin from the given Settings, Pipeline, and Network.
func New(settings Settings, pipeline drone.Pipeline, network drone.Network) drone.Plugin {
func New(settings Settings, pipeline drone.Pipeline, network drone.Network) *Plugin {
return &Plugin{
settings: settings,
pipeline: pipeline,

View File

@ -5,9 +5,11 @@ import (
)
func readStringOrFile(input string) (string, bool, error) {
//nolint:gomnd
if len(input) > 255 {
return input, false, nil
}
// Check if input is a file path
if _, err := os.Stat(input); err != nil && os.IsNotExist(err) {
// No file found => use input as result
@ -15,9 +17,11 @@ func readStringOrFile(input string) (string, bool, error) {
} else if err != nil {
return "", false, err
}
result, err := os.ReadFile(input)
if err != nil {
return "", true, err
}
return string(result), true, nil
}

View File

@ -1,4 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>thegeeklab/renovate-presets:golang"]
}