WIP: Keywords cleanup and presubmit action #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | ||
pull_request: | ||
jobs: | ||
verify-keywords: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | ||
with: | ||
egress-policy: audit | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
- name: Verify keywords | ||
shell: bash | ||
id: verify-keywords | ||
run: | | ||
set -e | ||
cd "${GITHUB_WORKSPACE}" | ||
echo 'Verifying allowed keywords ...' | ||
# Don't fail because of grep | ||
set +o pipefail | ||
find ./images -name '*metadata.yaml' | while read -r file; do | ||
if yq eval '.keywords[]' "$file" | grep -voE '(application|base|fips|ai|ai-gpu|stigs|featured)'; then | ||
echo "$file" has keywords that are not on allow list. Please update. >> output_log.txt | ||
fi | ||
done | ||
- name: Output results | ||
shell: bash | ||
id: output-results | ||
run: | | ||
echo "Result: $(cat output_log.txt)" >> $GITHUB_OUTPUT | ||
run: | | ||
Check failure on line 31 in .github/workflows/presubmit-metadata.yaml GitHub Actions / .github/workflows/presubmit-metadata.yamlInvalid workflow file
|
||
set -e | ||
if [ -s output_log.txt ]; then | ||
exit 1 | ||
fi |