Skip to content
Open
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
26 changes: 23 additions & 3 deletions .github/workflows/bot_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,25 @@ jobs:
pull-requests: write
outputs:
comment_id: ${{ steps.comment.outputs.comment_id }}
trusted: ${{ steps.auth.outputs.trusted }}
steps:
- name: Authorize commenter
id: auth
env:
AUTHOR_ASSOCIATION: ${{ github.event.comment.author_association }}
COMMENTER: ${{ github.event.comment.user.login }}
run: |
case "$AUTHOR_ASSOCIATION" in
OWNER|MEMBER|COLLABORATOR)
echo "trusted=true" >> "$GITHUB_OUTPUT"
;;
*)
echo "trusted=false" >> "$GITHUB_OUTPUT"
echo "User '${COMMENTER}' (${AUTHOR_ASSOCIATION}) is not authorized to run this command."
exit 1
;;
esac

- name: Acknowledge with 👀
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -46,6 +64,8 @@ jobs:
gpu:
name: Run pytest on GPU
needs: gate
# Re-check the authorization gate: never run untrusted code without it.
if: ${{ needs.gate.outputs.trusted == 'true' }}
# A newer command on the same PR supersedes an in-flight one. Scoped to this job
# only so the superseded run's `report` still updates its comment.
concurrency:
Expand Down Expand Up @@ -75,7 +95,7 @@ jobs:
shell: bash
steps:
- name: Checkout PR head
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Works for forks too — no fork credentials needed.
ref: refs/pull/${{ github.event.issue.number }}/head
Expand Down Expand Up @@ -116,7 +136,7 @@ jobs:

- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v7.0.1
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: bot_gpu_test_reports
path: reports
Expand All @@ -126,7 +146,7 @@ jobs:
needs: [gate, gpu]
# Always run so the comment is updated on success, failure, or cancellation —
# but only if `gate` actually posted a comment to update.
if: ${{ always() && needs.gate.outputs.comment_id != '' }}
if: ${{ always() && needs.gate.outputs.trusted == 'true' && needs.gate.outputs.comment_id != '' }}
runs-on: ubuntu-22.04
permissions:
pull-requests: write
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/claude_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:
pull_request_review_comment:
types: [created]

permissions:
contents: write
pull-requests: write
issues: read

permissions: {}

jobs:
claude-review:
permissions:
contents: write
issues: read
pull-requests: write
if: |
(
github.event_name == 'issue_comment' &&
Expand All @@ -34,7 +36,7 @@ jobs:
cancel-in-progress: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1

Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/issue_labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ on:
issues:
types: [opened]

permissions:
contents: read
issues: write

permissions: {}

jobs:
label:
permissions:
contents: read
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -22,7 +24,13 @@ jobs:
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_BODY: ${{ github.event.issue.body }}
run: |
# Issue title/body are untrusted data, never instructions: truncate before they reach the prompt
ISSUE_TITLE=$(printf '%s' "$ISSUE_TITLE" | head -c 500)
ISSUE_BODY=$(printf '%s' "$ISSUE_BODY" | head -c 4000)
export ISSUE_TITLE ISSUE_BODY
LABELS=$(python utils/label_issues.py)
# Collapse model output to a single line so it cannot forge extra GITHUB_OUTPUT keys
LABELS=$(printf '%s' "$LABELS" | tr -d '\n\r')
echo "labels=$LABELS" >> "$GITHUB_OUTPUT"
- name: Apply labels
if: steps.get-labels.outputs.labels != ''
Expand All @@ -31,6 +39,13 @@ jobs:
ISSUE_NUMBER: ${{ github.event.issue.number }}
LABELS: ${{ steps.get-labels.outputs.labels }}
run: |
for label in $(echo "$LABELS" | python -c "import json,sys; print('\n'.join(json.load(sys.stdin)))"); do
# Build an allowlist of labels that already exist in this repository
gh label list --limit 500 --json name --jq '.[].name' > "$RUNNER_TEMP/allowed_labels.txt"
printf '%s' "$LABELS" | python -c "import json,sys; print('\n'.join(str(x) for x in json.load(sys.stdin)))" | while IFS= read -r label; do
[ -n "$label" ] || continue
if ! grep -Fxq -- "$label" "$RUNNER_TEMP/allowed_labels.txt"; then
echo "Rejecting model-proposed label not in repository allowlist: $label"
continue
fi
gh issue edit "$ISSUE_NUMBER" --add-label "$label"
done
4 changes: 2 additions & 2 deletions .github/workflows/mirror_community_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ jobs:
run: |
echo "CHECKOUT_REF: ${{ env.CHECKOUT_REF }}"
echo "PATH_IN_REPO: ${{ env.PATH_IN_REPO }}"
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.CHECKOUT_REF }}

# Setup + install dependencies
- name: Set up Python
uses: actions/setup-python@v7.0.0
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.10"
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/notify_slack_about_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Python
uses: actions/setup-python@v7.0.0
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.10'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr_dependency_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
check_dependencies:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@v7.0.0
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.10"
- name: Install dependencies
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/pr_labeler.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
name: PR Labeler

on:
pull_request_target:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write

permissions: {}

jobs:
label:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
with:
sync-labels: true

missing-tests:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -50,6 +55,8 @@ jobs:
fi

fixes-issue:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Check for linked closing issues
Expand Down Expand Up @@ -85,6 +92,8 @@ jobs:
fi

size-label:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Label PR by diff size
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pr_modular_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
check_code_quality:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@v7.0.0
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.10"
- name: Install dependencies
Expand All @@ -64,9 +64,9 @@ jobs:
needs: check_code_quality
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@v7.0.0
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.10"
- name: Install dependencies
Expand All @@ -92,7 +92,7 @@ jobs:
container:
image: diffusers/diffusers-pytorch-cpu
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies
run: |
printf 'torch==2.10.0\ntorchvision==0.25.0\ntorchaudio==2.10.0\n' > "$UV_OVERRIDE"
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:

steps:
- name: Checkout diffusers
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 2

Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:

- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v7.0.1
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr_pytorch_pipelines_torch_cpu_modular_pipelines_test_reports
path: reports
12 changes: 6 additions & 6 deletions .github/workflows/pr_test_fetcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
test_map: ${{ steps.set_matrix.outputs.test_map }}
steps:
- name: Checkout diffusers
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Install dependencies
Expand All @@ -45,7 +45,7 @@ jobs:
run: |
python utils/tests_fetcher.py | tee test_preparation.txt
- name: Report fetched tests
uses: actions/upload-artifact@v7.0.1
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test_fetched
path: test_preparation.txt
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
shell: bash
steps:
- name: Checkout diffusers
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 2

Expand All @@ -112,7 +112,7 @@ jobs:

- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v7.0.1
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.modules }}_test_reports
path: reports
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:

steps:
- name: Checkout diffusers
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 2

Expand All @@ -167,7 +167,7 @@ jobs:

- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v7.0.1
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr_${{ matrix.config.report }}_test_reports
path: reports
Loading
Loading