Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
VERSION_TAG: v${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}
MAJOR_TAG: v${{ steps.version.outputs.major }}
MINOR_TAG: v${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}
REF_NAME: ${{ github.ref_name }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
Expand All @@ -115,7 +116,7 @@ jobs:
git tag "$MINOR_TAG" --force
fi

git push origin ${{ github.ref_name }}
git push origin "$REF_NAME"
git push origin --tags --force

# Create or update the release (supports promotion from prerelease)
Expand Down
28 changes: 22 additions & 6 deletions .github/workflows/sec-opengrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,36 @@ jobs:
uses: actions/checkout@v6

- name: "Download / Install Opengrep"
env:
GH_TOKEN: ${{ github.token }}
run: |
set -e
echo "[+] Fetching latest Opengrep release information"
API_URL="https://api.github.com/repos/opengrep/opengrep/releases/latest"
ASSET_NAME="opengrep_manylinux_x86"
DOWNLOAD_URL=$(curl -s $API_URL | jq -r ".assets[] | select(.name==\"${ASSET_NAME}\") | .browser_download_url")

# Fetch latest release metadata and extract download URL + digest
RELEASE_JSON=$(gh api repos/opengrep/opengrep/releases/latest)
DOWNLOAD_URL=$(echo "$RELEASE_JSON" | jq -r ".assets[] | select(.name==\"${ASSET_NAME}\") | .browser_download_url")
EXPECTED_SHA=$(echo "$RELEASE_JSON" | jq -r ".assets[] | select(.name==\"${ASSET_NAME}\") | .digest" | sed 's/sha256://')
VERSION=$(echo "$RELEASE_JSON" | jq -r ".tag_name")

if [ -z "$DOWNLOAD_URL" ] || [ "$DOWNLOAD_URL" = "null" ]; then
echo "Could not find download URL for $ASSET_NAME"
echo "::error::Could not find download URL for $ASSET_NAME"
exit 1
fi
echo "[+] Downloading Opengrep from $DOWNLOAD_URL"

echo "[+] Downloading Opengrep ${VERSION} from $DOWNLOAD_URL"
curl -sSfL -o "/usr/local/bin/opengrep" "$DOWNLOAD_URL"

# Verify integrity against API-reported digest
ACTUAL_SHA=$(sha256sum /usr/local/bin/opengrep | awk '{print $1}')
if [ "$ACTUAL_SHA" != "$EXPECTED_SHA" ]; then
echo "::error::SHA256 mismatch! Expected: $EXPECTED_SHA, Got: $ACTUAL_SHA"
exit 1
fi
echo "[+] SHA256 verified: $ACTUAL_SHA"

chmod +x /usr/local/bin/opengrep
echo "[+] Finished installing opengrep"
echo "[+] Finished installing opengrep ${VERSION}"

- name: "Run Opengrep"
run: opengrep scan --sarif-output ./results.sarif .
Expand Down
Loading