Skip to content

Commit 1c64b90

Browse files
authored
feat: added act for local pr check (#423)
1 parent 30aa32e commit 1c64b90

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,21 @@ else
9393
$(shell gosec -quiet -log gosec.log -out=gosecresults.csv -fmt=csv ./...)
9494
endif
9595
@echo "Logs are stored at gosec.log, Outputfile at gosecresults.csv"
96+
97+
98+
.PHONY: actions action-help
99+
actions: ## Run all GitHub Action checks that run on a pull request creation
100+
@echo "Running all GitHub Action checks for pull request events..."
101+
@act -l | grep -v ^Stage | grep pull_request | grep -v image_security_scan | awk '{print $$2}' | while read WF; do \
102+
echo "Running workflow: $${WF}"; \
103+
act pull_request --no-cache-server --platform ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest --job "$${WF}"; \
104+
done
105+
106+
action-help: ## Echo instructions to run one specific workflow locally
107+
@echo "GitHub Workflows can be run locally with the following command:"
108+
@echo "act pull_request --no-cache-server --platform ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest --job <jobid>"
109+
@echo ""
110+
@echo "Where '<jobid>' is a Job ID returned by the command:"
111+
@echo "act -l"
112+
@echo ""
113+
@echo "NOTE: if act is not installed, it can be downloaded from https://github.com/nektos/act"

0 commit comments

Comments
 (0)