github.com/yogeshkumararora/slsa-github-generator@v1.10.1-0.20240520161934-11278bd5afb4/.github/actions/sign-attestations/Makefile (about)

     1  # Copyright 2023 SLSA Authors
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #      http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  SHELL := /bin/bash
    16  ACTION_NAME = $(shell basename "$$(pwd)")
    17  
    18  .PHONY: help
    19  help: ## Shows all targets and help from the Makefile (this message).
    20  	@echo "$(ACTION_NAME) Makefile"
    21  	@echo "Usage: make [COMMAND]"
    22  	@echo ""
    23  	@grep --no-filename -E '^([/a-z.A-Z0-9_%-]+:.*?|)##' $(MAKEFILE_LIST) | \
    24  		awk 'BEGIN {FS = "(:.*?|)## ?"}; { \
    25  			if (length($$1) > 0) { \
    26  				printf "  \033[36m%-20s\033[0m %s\n", $$1, $$2; \
    27  			} else { \
    28  				if (length($$2) > 0) { \
    29  					printf "%s\n", $$2; \
    30  				} \
    31  			} \
    32  		}'
    33  
    34  node_modules/.installed: package.json package-lock.json
    35  	npm ci
    36  	touch node_modules/.installed
    37  
    38  .PHONY: action
    39  action: node_modules/.installed ## Builds the action.
    40  	npm run build
    41  
    42  .PHONY: package
    43  package: action ## Builds the distribution package.
    44  	npm run package
    45  
    46  .PHONY: clean
    47  clean:
    48  	rm -rf dist lib node_modules
    49  
    50  ## Tools
    51  #####################################################################
    52  
    53  .PHONY: format
    54  format: node_modules/.installed ## Formats code.
    55  	npm run format
    56  
    57  ## Testing
    58  #####################################################################
    59  
    60  .PHONY: unit-test
    61  unit-test: node_modules/.installed ## Runs all unit tests.
    62  	npm run test
    63  
    64  .PHONY: lint
    65  lint: node_modules/.installed ## Runs eslint.
    66  	npm run lint