mirror of
https://github.com/projectdiscovery/nuclei-templates.git
synced 2026-01-31 15:53:33 +08:00
fix: fetch enhancement script from base branch if missing in PR
When PRs come from forks that were created before the enhance-cve-fields.py script was added, the workflow fails because the script doesn't exist in the PR branch. This fix checks if the script exists and fetches it from the base branch if needed. Fixes https://github.com/projectdiscovery/nuclei-templates/actions/runs/20262489530/job/58177646081
This commit is contained in:
6
.github/workflows/cve-enhancement.yml
vendored
6
.github/workflows/cve-enhancement.yml
vendored
@@ -41,6 +41,12 @@ jobs:
|
||||
- name: Enhance CVE templates
|
||||
if: steps.files.outputs.changed == 'true'
|
||||
run: |
|
||||
# Fetch enhancement script from base branch if not present in PR branch
|
||||
if [ ! -f ".github/scripts/enhance-cve-fields.py" ]; then
|
||||
echo "Enhancement script not found in PR branch, fetching from base branch..."
|
||||
git fetch origin ${{ github.event.pull_request.base.ref }}
|
||||
git checkout origin/${{ github.event.pull_request.base.ref }} -- .github/scripts/enhance-cve-fields.py
|
||||
fi
|
||||
while read file; do
|
||||
[ -f "$file" ] && python .github/scripts/enhance-cve-fields.py "$file"
|
||||
done < /tmp/cve_files.txt
|
||||
|
||||
Reference in New Issue
Block a user