Skip to content
Closed
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
23 changes: 16 additions & 7 deletions .github/workflows/audit-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
issue_comment:
types: [created]
workflow_dispatch:

permissions:
contents: read
Expand All @@ -30,17 +31,21 @@ jobs:
which jq

- name: Create source archive
id: archive
shell: bash
run: |
rm -f /tmp/code.zip
zip -r /tmp/code.zip .
ARCHIVE_NAME="${{ github.event.repository.name }}.zip"
rm -f "/tmp/${ARCHIVE_NAME}"
zip -r "/tmp/${ARCHIVE_NAME}" .
echo "archive_name=${ARCHIVE_NAME}" >> "$GITHUB_OUTPUT"

- name: Call audit service
id: audit
shell: bash
run: |
RESPONSE=$(curl -s -X POST "${{ vars.AUDIT_SERVICE_URL }}/audit-pr/${{ vars.AUDIT_PR_SKILL }}" \
-H "X-API-Key: ${{ secrets.AUDIT_API_KEY }}" \
-F "file=@/tmp/code.zip" \
-F "file=@/tmp/${{ steps.archive.outputs.archive_name }}" \
-F "from_branch=main" \
-F "to_branch=main")

Expand Down Expand Up @@ -75,7 +80,7 @@ jobs:
if: >
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.body == '/audit-pr' &&
contains(github.event.comment.body, '/audit-pr') &&
contains(format(',{0},', vars.AUDIT_ALLOWED_USERS), format(',{0},', github.event.comment.user.login))
runs-on: [self-hosted, Linux, ARM64, audit-linux]

Expand Down Expand Up @@ -107,17 +112,21 @@ jobs:
which jq

- name: Create source archive
id: archive
shell: bash
run: |
rm -f /tmp/code.zip
zip -r /tmp/code.zip .
ARCHIVE_NAME="${{ github.event.repository.name }}.zip"
rm -f "/tmp/${ARCHIVE_NAME}"
zip -r "/tmp/${ARCHIVE_NAME}" .
echo "archive_name=${ARCHIVE_NAME}" >> "$GITHUB_OUTPUT"

- name: Call audit service
id: audit
shell: bash
run: |
RESPONSE=$(curl -s -X POST "${{ vars.AUDIT_SERVICE_URL }}/audit-pr/${{ vars.AUDIT_PR_SKILL }}" \
-H "X-API-Key: ${{ secrets.AUDIT_API_KEY }}" \
-F "file=@/tmp/code.zip" \
-F "file=@/tmp/${{ steps.archive.outputs.archive_name }}" \
-F "from_branch=${{ steps.pr.outputs.base_ref }}" \
-F "to_branch=${{ steps.pr.outputs.head_ref }}")

Expand Down
23 changes: 16 additions & 7 deletions .github/workflows/audit-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
issue_comment:
types: [created]
workflow_dispatch:

permissions:
contents: read
Expand Down Expand Up @@ -35,17 +36,21 @@ jobs:
which jq

- name: Create source archive
id: archive
shell: bash
run: |
rm -f /tmp/code.zip
zip -r /tmp/code.zip .
ARCHIVE_NAME="${{ github.event.repository.name }}.zip"
rm -f "/tmp/${ARCHIVE_NAME}"
zip -r "/tmp/${ARCHIVE_NAME}" .
echo "archive_name=${ARCHIVE_NAME}" >> "$GITHUB_OUTPUT"

- name: Call audit service
id: audit
shell: bash
run: |
RESPONSE=$(curl -s -X POST "${{ vars.AUDIT_SERVICE_URL }}/audit-security/${{ vars.AUDIT_SECURITY_SKILL }}" \
-H "X-API-Key: ${{ secrets.AUDIT_API_KEY }}" \
-F "file=@/tmp/code.zip")
-F "file=@/tmp/${{ steps.archive.outputs.archive_name }}")

echo "Audit response:"
echo "$RESPONSE" | jq .
Expand Down Expand Up @@ -78,7 +83,7 @@ jobs:
if: >
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.body == '/audit-security' &&
contains(github.event.comment.body, '/audit-security') &&
contains(format(',{0},', vars.AUDIT_ALLOWED_USERS), format(',{0},', github.event.comment.user.login))
runs-on: [self-hosted, Linux, ARM64, audit-linux]

Expand Down Expand Up @@ -115,17 +120,21 @@ jobs:
which jq

- name: Create source archive
id: archive
shell: bash
run: |
rm -f /tmp/code.zip
zip -r /tmp/code.zip .
ARCHIVE_NAME="${{ github.event.repository.name }}.zip"
rm -f "/tmp/${ARCHIVE_NAME}"
zip -r "/tmp/${ARCHIVE_NAME}" .
echo "archive_name=${ARCHIVE_NAME}" >> "$GITHUB_OUTPUT"

- name: Call audit service
id: audit
shell: bash
run: |
RESPONSE=$(curl -s -X POST "${{ vars.AUDIT_SERVICE_URL }}/audit-security/${{ vars.AUDIT_SECURITY_SKILL }}" \
-H "X-API-Key: ${{ secrets.AUDIT_API_KEY }}" \
-F "file=@/tmp/code.zip")
-F "file=@/tmp/${{ steps.archive.outputs.archive_name }}")

echo "Audit response:"
echo "$RESPONSE" | jq .
Expand Down