initial commit
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Robert Kaussow 2023-08-17 10:31:47 +02:00
parent dfd11c4bf5
commit 83d4fa7646
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
5 changed files with 90 additions and 94 deletions

72
.drone.yml Normal file
View File

@ -0,0 +1,72 @@
---
kind: pipeline
name: test
platform:
os: linux
arch: amd64
concurrency:
limit: 1
steps:
- name: markdownlint
image: quay.io/thegeeklab/markdownlint-cli
commands:
- markdownlint 'README.md'
- name: spellcheck
image: quay.io/thegeeklab/alpine-tools
commands:
- spellchecker --files 'README.md' -d .dictionary -p spell indefinite-article syntax-urls
environment:
FORCE_COLOR: true
NPM_CONFIG_LOGLEVEL: error
- name: lint
image: docker.io/koalaman/shellcheck-alpine:stable
commands:
- grep -ErlI '^#!(.*/|.*env +)(sh|bash|ksh)' ./shell/ | xargs -r shellcheck
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
---
kind: pipeline
name: notifications
platform:
os: linux
arch: amd64
steps:
- name: matrix
image: quay.io/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 }}){{ end }} 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:
- build

55
.github/settings.yml vendored
View File

@ -1,55 +0,0 @@
repository:
name: helpers
topics: cli, tools, shell, cheatsheet
private: false
has_issues: true
has_wiki: false
has_downloads: true
default_branch: main
allow_squash_merge: true
allow_merge_commit: true
allow_rebase_merge: true
labels:
- name: bug
color: d73a4a
description: Something isn't working
- name: documentation
color: 0075ca
description: Improvements or additions to documentation
- name: duplicate
color: cfd3d7
description: This issue or pull request already exists
- name: enhancement
color: a2eeef
description: New feature or request
- name: good first issue
color: 7057ff
description: Good for newcomers
- name: help wanted
color: 008672
description: Extra attention is needed
- name: invalid
color: e4e669
description: This doesn't seem right
- name: question
color: d876e3
description: Further information is requested
- name: wontfix
color: ffffff
description: This will not be worked on
branches:
- name: main
protection:
required_pull_request_reviews: null
required_status_checks:
strict: false
contexts:
- ci/woodpecker/pr/test
enforce_admins: false
required_linear_history: true
restrictions: null

View File

@ -1,26 +0,0 @@
---
when:
- event: [tag]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
runs_on: [success, failure]
steps:
matrix:
image: quay.io/thegeeklab/wp-matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
roomid:
from_secret: matrix_roomid
username:
from_secret: matrix_username
when:
- status: [success, failure]
depends_on:
- test

View File

@ -1,13 +0,0 @@
---
when:
- event: [pull_request, tag]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
steps:
lint:
group: test
image: docker.io/koalaman/shellcheck-alpine:stable
commands:
- grep -ErlI '^#!(.*/|.*env +)(sh|bash|ksh)' ./shell/ | xargs -r shellcheck

18
shell/gitea-batchmerge.sh Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
## requirements: httpie
set -eo pipefail
GITEA_SERVER=https://gitea.example.com
GITEA_TOKEN=my-private-token
GITEA_USER="gitea"
GITEA_PR_TITLE=
http "https://${GITEA_SERVER}/api/v1/user" 'Authorization:token '"${GITEA_TOKEN}"''
for repo in $(http -b "https://${GITEA_SERVER}/api/v1/users/${GITEA_USER}/repos" 'Authorization:token '"${GITEA_TOKEN}"'' | jq -r '.[] | .full_name'); do
for pr_number in $(http -b "https://${GITEA_SERVER}/api/v1/repos/${repo}/pulls" 'Authorization:token '"${GITEA_TOKEN}"'' state==open | jq -r '.[] | select(.title | contains("'"${GITEA_PR_TITLE}"'")) | .number'); do
http POST "https://${GITEA_SERVER}/api/v1/repos/${repo}/pulls/${pr_number}/merge" 'Authorization:token '"${GITEA_TOKEN}"'' do=squash
done
done