ci: add pre-push hook to prevent direct pushes to main (#33)
* ci: add pre-push hook to prevent direct pushes to main * ci: grant pull-requests read permission to commitlint job
This commit is contained in:
@@ -27,6 +27,8 @@ jobs:
|
|||||||
name: Lint PR Title
|
name: Lint PR Title
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
steps:
|
steps:
|
||||||
- uses: amannn/action-semantic-pull-request@v5
|
- uses: amannn/action-semantic-pull-request@v5
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ VERSION ?= dev
|
|||||||
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
|
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
|
||||||
LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)'
|
LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)'
|
||||||
|
|
||||||
dev: generate clean
|
dev: setup generate clean
|
||||||
WEBKIT_DISABLE_DMABUF_RENDERER=1 wails dev -tags webkit2_41 -loglevel Debug -v 2
|
WEBKIT_DISABLE_DMABUF_RENDERER=1 wails dev -tags webkit2_41 -loglevel Debug -v 2
|
||||||
|
|
||||||
build-dev: generate
|
build-dev: generate
|
||||||
|
|||||||
@@ -31,6 +31,18 @@ pre-commit:
|
|||||||
pre-push:
|
pre-push:
|
||||||
parallel: true
|
parallel: true
|
||||||
commands:
|
commands:
|
||||||
|
protect-main:
|
||||||
|
run: |
|
||||||
|
while read local_ref local_sha remote_ref remote_sha; do
|
||||||
|
if [ "$remote_ref" = "refs/heads/main" ]; then
|
||||||
|
echo "Direct push to main is not allowed. Use a pull request instead."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
skip:
|
||||||
|
- merge
|
||||||
|
- rebase
|
||||||
|
|
||||||
go-test:
|
go-test:
|
||||||
glob: "*.go"
|
glob: "*.go"
|
||||||
run: go test -tags webkit2_41 -race -count=1 -timeout 120s ./...
|
run: go test -tags webkit2_41 -race -count=1 -timeout 120s ./...
|
||||||
|
|||||||
Reference in New Issue
Block a user