From 1c64b9006807aebd2e47760a63d0ee9d5cfb2c48 Mon Sep 17 00:00:00 2001 From: mgandharva <124261698+mgandharva@users.noreply.github.com> Date: Thu, 6 Feb 2025 21:31:16 +0530 Subject: [PATCH] feat: added act for local pr check (#423) --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Makefile b/Makefile index 08e03faf..502ea766 100644 --- a/Makefile +++ b/Makefile @@ -93,3 +93,21 @@ else $(shell gosec -quiet -log gosec.log -out=gosecresults.csv -fmt=csv ./...) endif @echo "Logs are stored at gosec.log, Outputfile at gosecresults.csv" + + +.PHONY: actions action-help +actions: ## Run all GitHub Action checks that run on a pull request creation + @echo "Running all GitHub Action checks for pull request events..." + @act -l | grep -v ^Stage | grep pull_request | grep -v image_security_scan | awk '{print $$2}' | while read WF; do \ + echo "Running workflow: $${WF}"; \ + act pull_request --no-cache-server --platform ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest --job "$${WF}"; \ + done + +action-help: ## Echo instructions to run one specific workflow locally + @echo "GitHub Workflows can be run locally with the following command:" + @echo "act pull_request --no-cache-server --platform ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest --job " + @echo "" + @echo "Where '' is a Job ID returned by the command:" + @echo "act -l" + @echo "" + @echo "NOTE: if act is not installed, it can be downloaded from https://github.com/nektos/act"