Skip to content

Commit 8ebfe78

Browse files
authored
Gobrick/Add Makefile Targets for Local PR Checks (#79)
1 parent 47afb5b commit 8ebfe78

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Makefile

+17
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,20 @@ check:
99

1010
gocover:
1111
go tool cover -html=c.out
12+
13+
.PHONY: actions action-help
14+
actions: ## Run all GitHub Action checks that run on a pull request creation
15+
@echo "Running all GitHub Action checks for pull request events..."
16+
@act -l | grep -v ^Stage | grep pull_request | grep -v image_security_scan | awk '{print $$2}' | while read WF; do \
17+
echo "Running workflow: $${WF}"; \
18+
act pull_request --no-cache-server --platform ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest --job "$${WF}"; \
19+
done
20+
21+
action-help: ## Echo instructions to run one specific workflow locally
22+
@echo "GitHub Workflows can be run locally with the following command:"
23+
@echo "act pull_request --no-cache-server --platform ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest --job <jobid>"
24+
@echo ""
25+
@echo "Where '<jobid>' is a Job ID returned by the command:"
26+
@echo "act -l"
27+
@echo ""
28+
@echo "NOTE: if act is not installed, it can be downloaded from https://github.com/nektos/act"

0 commit comments

Comments
 (0)