Skip to content

Bump the github-actions group across 1 directory with 2 updates #869

Bump the github-actions group across 1 directory with 2 updates

Bump the github-actions group across 1 directory with 2 updates #869

name: Vpatch collection lint
on:
push:
paths:
- "appsec-rules/**.yaml"
- "appsec-rules/**.yml"
- ".github/workflows/appsec_vpatch_lint.yaml"
- "collections/crowdsecurity/appsec-virtual-patching.yaml"
- "src/cshub/appsec_vpatch_lint.py"
- "pyproject.toml"
- "uv.lock"
permissions:
contents: read
pull-requests: write
jobs:
update-taxonomy:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
version: 0.5.24
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: set up python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version-file: ".python-version"
- name: Get changed files
run: |
changed_files=$(git diff-tree --no-commit-id --name-only -r "$GITHUB_SHA" | tr '\n' ',' | sed 's/,$/\n/')
echo "changed_files=${changed_files}" >> "$GITHUB_ENV"
- name: Create local changes
env:
AUTHOR: ${{ github.actor }}
run: |
uv sync --all-extras --dev --locked
uv run appsec-vpatch-lint -e appsec_vpatch_cve_error.md --hub ./
[ -f "appsec_vpatch_cve_error.md" ] && echo "taxonomy_errors=1" >> "$GITHUB_ENV" || echo "taxonomy_errors=0" >> "$GITHUB_ENV"
- name: Comment PR if errors
if: ${{ (env.taxonomy_errors == '1') && (github.event_name == 'push') && (github.ref != 'refs/heads/master') }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
BRANCH_NAME: ${{ github.ref_name }}
run: |
set -euo pipefail
pr=$(gh pr list --head "$BRANCH_NAME" --state open --json number --jq '.[0].number // empty')
if [ -n "$pr" ]; then
gh pr comment "$pr" --body-file appsec_vpatch_cve_error.md
else
echo "No open PR for $BRANCH_NAME; skipping comment"
fi