Compare commits
5 Commits
go-1732-ad
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| ff27016534 | |||
| e0d234213e | |||
| 3242503554 | |||
| 8dce67f3d2 | |||
| a1475ca95b |
@ -1,27 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# The script below adds the branch name automatically to
|
|
||||||
# every one of your commit messages. The regular expression
|
|
||||||
# below searches for linear issue key's. The issue key will
|
|
||||||
# be extracted out of your branch name
|
|
||||||
|
|
||||||
REGEX_ISSUE_ID="[a-zA-Z0-9]+-[0-9]+"
|
|
||||||
|
|
||||||
# Find current branch name
|
|
||||||
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
|
|
||||||
COMMIT_MSG_FILE=$1
|
|
||||||
COMMIT_TEXT=$(cat "$COMMIT_MSG_FILE")
|
|
||||||
|
|
||||||
if [[ -z "$BRANCH_NAME" ]]; then
|
|
||||||
echo "Commit message validation failed: no branch name!"; exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Extract issue id from branch name
|
|
||||||
ISSUE_ID=$(echo "$BRANCH_NAME" | grep -o -E "$REGEX_ISSUE_ID" | head -1 | awk '{print toupper($0)}')
|
|
||||||
|
|
||||||
if [[ "$ISSUE_ID" != "GO-"* ]]; then
|
|
||||||
echo "Commit message validation failed: branch name should contain issue name!"; exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$COMMIT_TEXT" != "GO-"* ]]; then
|
|
||||||
echo "$ISSUE_ID" "$COMMIT_TEXT" > "$COMMIT_MSG_FILE"
|
|
||||||
fi
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
INSTALL_PYTHON=python3
|
|
||||||
ARGS=(hook-impl --config=.pre-commit-config.yaml --hook-type=pre-push)
|
|
||||||
# end templated
|
|
||||||
|
|
||||||
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
||||||
ARGS+=(--hook-dir "$HERE" -- "$@")
|
|
||||||
|
|
||||||
if [ -x "$INSTALL_PYTHON" ]; then
|
|
||||||
exec "$INSTALL_PYTHON" -mpre_commit "${ARGS[@]}"
|
|
||||||
elif command -v pre-commit > /dev/null; then
|
|
||||||
exec pre-commit "${ARGS[@]}"
|
|
||||||
else
|
|
||||||
echo '`pre-commit` not found. Please visit https://wiki.anytype.io/doc/mandatory-git-hooks-5rQt1Qyw7k ' 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
48
.github/workflows/coverage.yml
vendored
48
.github/workflows/coverage.yml
vendored
@ -3,10 +3,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -21,35 +17,20 @@ jobs:
|
|||||||
- name: git config
|
- name: git config
|
||||||
run: git config --global url.https://${{ secrets.ANYTYPE_PAT }}@github.com/.insteadOf https://github.com/
|
run: git config --global url.https://${{ secrets.ANYTYPE_PAT }}@github.com/.insteadOf https://github.com/
|
||||||
|
|
||||||
# cache {{
|
# # cache {{
|
||||||
- id: go-cache-paths
|
# - id: go-cache-paths
|
||||||
run: |
|
# run: |
|
||||||
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
# echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
||||||
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
# echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
||||||
- uses: actions/cache@v3
|
# - uses: actions/cache@v3
|
||||||
with:
|
# with:
|
||||||
path: |
|
# path: |
|
||||||
${{ steps.go-cache-paths.outputs.GOCACHE }}
|
# ${{ steps.go-cache-paths.outputs.GOCACHE }}
|
||||||
${{ steps.go-cache-paths.outputs.GOMODCACHE }}
|
# ${{ steps.go-cache-paths.outputs.GOMODCACHE }}
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
# key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||||
restore-keys: |
|
# restore-keys: |
|
||||||
${{ runner.os }}-go-${{ matrix.go-version }}-
|
# ${{ runner.os }}-go-${{ matrix.go-version }}-
|
||||||
# }}
|
# # }}
|
||||||
|
|
||||||
- name: Setup license repository
|
|
||||||
uses: actions/checkout@master
|
|
||||||
with:
|
|
||||||
repository: anyproto/open
|
|
||||||
ref: refs/heads/main
|
|
||||||
path: ./open
|
|
||||||
- name: Check licenses
|
|
||||||
run: |
|
|
||||||
cd open
|
|
||||||
python3 tools/generate.py --platform golang
|
|
||||||
cd ..
|
|
||||||
sudo gem install license_finder
|
|
||||||
license_finder inherited_decisions add open/decisions.yml
|
|
||||||
license_finder --enabled-package-managers gomodules
|
|
||||||
|
|
||||||
- name: deps
|
- name: deps
|
||||||
run: make deps
|
run: make deps
|
||||||
@ -74,4 +55,3 @@ jobs:
|
|||||||
echo "Failed"
|
echo "Failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
- uses: seriousben/go-patch-cover-action@v1
|
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
repos:
|
|
||||||
- repo: https://github.com/zricethezav/gitleaks
|
|
||||||
rev: v8.16.0
|
|
||||||
hooks:
|
|
||||||
- id: gitleaks
|
|
||||||
4
Makefile
4
Makefile
@ -2,10 +2,6 @@
|
|||||||
export GOPRIVATE=github.com/anyproto
|
export GOPRIVATE=github.com/anyproto
|
||||||
export PATH:=deps:$(PATH)
|
export PATH:=deps:$(PATH)
|
||||||
|
|
||||||
all:
|
|
||||||
@set -e;
|
|
||||||
@git config core.hooksPath .githooks;
|
|
||||||
|
|
||||||
proto:
|
proto:
|
||||||
@echo 'Generating protobuf packages (Go)...'
|
@echo 'Generating protobuf packages (Go)...'
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user