mirror of
https://github.com/gradio-app/gradio.git
synced 2025-04-12 12:40:29 +08:00
test semgrep 2 (#9509)
* test semgrep 2 * add changeset * status * add yml : --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
b25a64e98b
commit
cc9674b101
5
.changeset/swift-pumas-fail.md
Normal file
5
.changeset/swift-pumas-fail.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": minor
|
||||
---
|
||||
|
||||
feat:test semgrep 2
|
45
.github/workflows/semgrep.yml
vendored
45
.github/workflows/semgrep.yml
vendored
@ -2,7 +2,7 @@ name: Semgrep
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["trigger-changeset"]
|
||||
workflows: ["trigger-semgrep"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
@ -17,39 +17,32 @@ concurrency:
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
name: "changes"
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
should_run: ${{ steps.changes.outputs.should_run }}
|
||||
sha: ${{ steps.changes.outputs.sha }}
|
||||
source_branch: ${{ steps.changes.outputs.source_branch }}
|
||||
source_repo: ${{ steps.changes.outputs.source_repo }}
|
||||
pr_number: ${{ steps.changes.outputs.pr_number }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: "gradio-app/gradio/.github/actions/changes@main"
|
||||
id: changes
|
||||
with:
|
||||
filter: "gradio"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
semgrep:
|
||||
permissions:
|
||||
contents: read
|
||||
name: semgrep/ci
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
container:
|
||||
image: semgrep/semgrep
|
||||
outputs:
|
||||
pr_number: ${{ steps.json.outputs.pr_number }}
|
||||
sha: ${{ steps.json.outputs.sha }}
|
||||
if: (github.actor != 'dependabot[bot]')
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: changes
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
- uses: gradio-app/github/actions/json-to-output@main
|
||||
id: json
|
||||
with:
|
||||
path: output.json
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ needs.changes.outputs.source_repo }}
|
||||
ref: ${{ needs.changes.outputs.sha }}
|
||||
repository: ${{ steps.json.outputs.source_repo }}
|
||||
ref: ${{ steps.json.outputs.sha }}
|
||||
- run: semgrep ci
|
||||
env:
|
||||
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN2 }}
|
||||
@ -58,14 +51,14 @@ jobs:
|
||||
actions: read
|
||||
statuses: write
|
||||
runs-on: ubuntu-latest
|
||||
needs: [changes, semgrep]
|
||||
needs: semgrep
|
||||
steps:
|
||||
- name: update status
|
||||
uses: gradio-app/github/actions/commit-status@main
|
||||
with:
|
||||
sha: ${{ needs.changes.outputs.sha }}
|
||||
sha: ${{ needs.semgrep.outputs.sha }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
name: "Semgrep Results"
|
||||
pr: ${{ needs.changes.outputs.pr_number }}
|
||||
pr: ${{ needs.semgrep.outputs.pr_number }}
|
||||
result: ${{ needs.semgrep.result == 'success' && 'success' || 'failure' }}
|
||||
type: all
|
29
.github/workflows/trigger-semgrep.yml
vendored
Normal file
29
.github/workflows/trigger-semgrep.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
name: trigger-changeset
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- 5.0-dev
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
name: "changes"
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
should_run: ${{ steps.changes.outputs.should_run }}
|
||||
sha: ${{ steps.changes.outputs.sha }}
|
||||
pr_number: ${{ steps.changes.outputs.pr_number }}
|
||||
source_branch: ${{ steps.changes.outputs.source_branch }}
|
||||
source_repo: ${{ steps.changes.outputs.source_repo }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: "gradio-app/gradio/.github/actions/changes@main"
|
||||
id: changes
|
||||
with:
|
||||
filter: "gradio"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
@ -1,5 +1,5 @@
|
||||
"""
|
||||
This file defines two useful high-level abstractions to build Gradio apps: Interface and TabbedInterface.
|
||||
This file defines two useful high-level abstractions to build Gradio apps: Interface and TabbedInterface.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
Loading…
x
Reference in New Issue
Block a user