Skip to content

First pass

First pass #1

Workflow file for this run

name: Post-Release Scan
on:
push:
branches:
- hjet/add-rl-scan
workflow_call:
inputs:
version_tag:
type: string
description: "Release version to scan"
required: true
default: "v0.5.3"
secrets:
RLSECURE_LICENSE:
required: true
RLSECURE_SITE_KEY:
required: true
SIGNAL_HANDLER_TOKEN:
required: true
PRODSEC_TOOLS_USER:
required: true
PRODSEC_TOOLS_TOKEN:
required: true
PRODSEC_TOOLS_ARN:
required: true
env:
VERSION_TAG: ${{ inputs.version_tag || 'v0.5.3' }}
jobs:
verify-release:
runs-on: ubuntu-latest
steps:
- name: Confirm gh CLI is installed
run: |
which gh
gh --version
- name: Download latest release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download $VERSION_TAG \
--repo "${{ github.repository }}" \
--clobber
echo "Downloaded all release files:"
ls -l || echo "No files downloaded."
- name: Verify checksums
run: |
CHECKSUM_FILE=$(ls -1 *_SHA256SUMS 2>/dev/null || true)
if [ -z "$CHECKSUM_FILE" ]; then
echo "No SHA256SUMS file found; failing the job..."
exit 1
fi
echo "Verifying checksums with $CHECKSUM_FILE..."
sha256sum --check "$CHECKSUM_FILE"
- name: Gather zip files
id: gather-zips
run: |
ZIPS=$(ls -1 *.zip 2>/dev/null)
if [ -z "$ZIPS" ]; then
echo "No ZIP files found to scan; failing..."
exit 1
fi
echo "Found ZIP files:"
echo "$ZIPS"
ZIPS_JSON=$(echo "$ZIPS" | jq -R . | jq -s .)
echo "zips=$ZIPS_JSON" >> $GITHUB_OUTPUT
- name: Upload ZIP artifacts
uses: actions/upload-artifact@v3
with:
name: zips
path: "*.zip"
scan-artifacts:
needs: verify-release
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
zip-file: ${{ fromJson(needs.verify-release.outputs.zips) }}
steps:
- name: Download ZIP artifacts
uses: actions/download-artifact@v3
with:
name: zips
path: "."
- name: Checkout repo
uses: actions/checkout@v3
- name: List files
run: ls -l
- name: Run RL Scanner
id: rl-scan-conclusion
uses: ./.github/actions/rl-scanner
with:
artifact-path: "$(pwd)/${{ matrix.zip-file }}"
version: "${{ env.VERSION_TAG }}"
env:
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}
- name: Output scan result
run: |
# Store the RL Scanner outcome in the GITHUB_ENV with a unique key per zip file
echo "scan-status-${{ matrix.zip-file }}=${{ steps.rl-scan-conclusion.outcome }}" >> $GITHUB_ENV
- name: Unzip first artifact
run: |
FIRST_ZIP=$(ls -1 *.zip 2>/dev/null | head -n1)
if [ -z "$FIRST_ZIP" ]; then
echo "No ZIP files found to unzip; failing..."
exit 1
fi
echo "First artifact: $FIRST_ZIP"
mkdir extracted
unzip -q "$FIRST_ZIP" -d extracted
echo "Contents of extracted/:"
ls -l extracted
- name: SHA of unzipped artifact
run: |
FIRST_FILE=$(ls -1 extracted | head -n1)
if [ -z "$FIRST_FILE" ]; then
echo "No files in 'extracted/' directory; failing..."
exit 1
fi
echo "Computing SHA of extracted/$FIRST_FILE ..."
sha256sum "extracted/$FIRST_FILE"
- name: Run RL Scanner
id: rl-scan-conclusion

Check failure on line 160 in .github/workflows/rl-scanner.yml

View workflow run for this annotation

GitHub Actions / Post-Release Scan

Invalid workflow file

The workflow is not valid. .github/workflows/rl-scanner.yml (Line: 160, Col: 13): The identifier 'rl-scan-conclusion' may not be used more than once within the same scope.
uses: ./.github/actions/rl-scanner
with:
artifact-path: "$(pwd)/${{ inputs.artifact-name }}"
version: "${{ steps.get_version.outputs.version }}"
env:
RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}
- name: Output scan result
run: echo "scan-status=${{ steps.rl-scan-conclusion.outcome }}" >> $GITHUB_ENV