1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-10-23 09:09:01 +03:00
Files
diffusers/.github/workflows/diffusers_bot.yml
dependabot[bot] 56ff371847 Bump the actions group across 1 directory with 13 updates
Updates the requirements on [actions/upload-artifact](https://github.com/actions/upload-artifact), [actions/github-script](https://github.com/actions/github-script), [actions/create-github-app-token](https://github.com/actions/create-github-app-token), [actions/download-artifact](https://github.com/actions/download-artifact), [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action), [docker/build-push-action](https://github.com/docker/build-push-action), [huggingface/doc-builder/.github/workflows/build_main_documentation.yml](https://github.com/huggingface/doc-builder), [huggingface/doc-builder/.github/workflows/build_pr_documentation.yml](https://github.com/huggingface/doc-builder), [anthropics/claude-code-action](https://github.com/anthropics/claude-code-action), [huggingface/tailscale-action](https://github.com/huggingface/tailscale-action), [trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog), [crate-ci/typos](https://github.com/crate-ci/typos) and [huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml](https://github.com/huggingface/doc-builder) to permit the latest version.

Updates `actions/upload-artifact` from 7.0.1 to 7.0.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](043fb46d1a...cf430e030d)

Updates `actions/github-script` from 8.0.0 to 9.0.0
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v8...3a2844b7e9c422d3c10d287c895573f7108da1b3)

Updates `actions/create-github-app-token` from 3.2.0 to 3.3.0
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Changelog](https://github.com/actions/create-github-app-token/blob/main/CHANGELOG.md)
- [Commits](bcd2ba4921...64ab729a62)

Updates `actions/download-artifact` from 8.0.1 to 8.0.2
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](3e5f45b2cf...9000827ccb)

Updates `docker/setup-buildx-action` from 4.2.0 to 4.4.1
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](bb05f3f551...f87e5991a6)

Updates `docker/build-push-action` from 7.3.0 to 7.4.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](53b7df96c9...c3c9e263c2)

Updates `huggingface/doc-builder/.github/workflows/build_main_documentation.yml` from 9fc8a41d7729c424fdb2192f2f85ff63102ec9a3 to fb57426dd755cecd0588386cf6f6f0c0381fce3d
- [Release notes](https://github.com/huggingface/doc-builder/releases)
- [Changelog](https://github.com/huggingface/doc-builder/blob/main/RELEASE.md)
- [Commits](9fc8a41d77...fb57426dd7)

Updates `huggingface/doc-builder/.github/workflows/build_pr_documentation.yml` from 9fc8a41d7729c424fdb2192f2f85ff63102ec9a3 to fb57426dd755cecd0588386cf6f6f0c0381fce3d
- [Release notes](https://github.com/huggingface/doc-builder/releases)
- [Changelog](https://github.com/huggingface/doc-builder/blob/main/RELEASE.md)
- [Commits](9fc8a41d77...fb57426dd7)

Updates `anthropics/claude-code-action` from 1.0.193 to 1.0.250
- [Release notes](https://github.com/anthropics/claude-code-action/releases)
- [Commits](9d7150bc8a...a26b07d8c7)

Updates `huggingface/tailscale-action` to 9d1a67c46875a956cf2d1975473da978a970a2a9
- [Release notes](https://github.com/huggingface/tailscale-action/releases)
- [Commits](9d1a67c468)

Updates `trufflesecurity/trufflehog` from 3.97.0 to 3.99.2
- [Release notes](https://github.com/trufflesecurity/trufflehog/releases)
- [Commits](bcfcf73aaf...e76dff8a7e)

Updates `crate-ci/typos` from 1.49.0 to 1.51.1
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/main/CHANGELOG.md)
- [Commits](8a48f81b6c...7f9d0819ca)

Updates `huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml` from 9fc8a41d7729c424fdb2192f2f85ff63102ec9a3 to fb57426dd755cecd0588386cf6f6f0c0381fce3d
- [Release notes](https://github.com/huggingface/doc-builder/releases)
- [Changelog](https://github.com/huggingface/doc-builder/blob/main/RELEASE.md)
- [Commits](9fc8a41d77...fb57426dd7)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: 3.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/github-script
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: anthropics/claude-code-action
  dependency-version: 1.0.248
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: crate-ci/typos
  dependency-version: 1.51.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: docker/build-push-action
  dependency-version: 7.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.4.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: huggingface/doc-builder/.github/workflows/build_main_documentation.yml
  dependency-version: 90ddd199e07144a13408c523680c76987343c95f
  dependency-type: direct:production
  dependency-group: actions
- dependency-name: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml
  dependency-version: 90ddd199e07144a13408c523680c76987343c95f
  dependency-type: direct:production
  dependency-group: actions
- dependency-name: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml
  dependency-version: 90ddd199e07144a13408c523680c76987343c95f
  dependency-type: direct:production
  dependency-group: actions
- dependency-name: huggingface/tailscale-action
  dependency-version: 9d1a67c46875a956cf2d1975473da978a970a2a9
  dependency-type: direct:production
  dependency-group: actions
- dependency-name: trufflesecurity/trufflehog
  dependency-version: 3.99.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-21 14:01:12 +00:00

120 lines
4.5 KiB
YAML

name: Diffusers Bot
# Maintainer commands, triggered by commenting on an open PR:
#
# /diffusers-bot style run `make style && make quality` and push the fixes to the PR branch
# /diffusers-bot review request a Serge AI review (also works from an inline review comment)
# /diffusers-bot pytest <args> run `pytest <args>` on a GPU runner, e.g.
# `/diffusers-bot pytest tests/models/test_modeling_common.py -k "some_test"`
#
# Auth is checked once in the `authorize` job. Each subcommand lives in its
# own reusable workflow file under .github/workflows/bot_*.yml.
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
# Default to read-only; calling jobs grant extra permissions to the sub-workflows
# that need them.
permissions:
contents: read
jobs:
# ── Shared gate: authorize commenter & parse subcommand ──────────────────────
authorize:
name: Authorize
if: |
(
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.issue.state == 'open' &&
contains(github.event.comment.body, '/diffusers-bot')
) || (
github.event_name == 'pull_request_review_comment' &&
contains(github.event.comment.body, '/diffusers-bot')
)
runs-on: ubuntu-latest
permissions:
pull-requests: read
contents: read
outputs:
is_authorized: ${{ steps.check.outputs.is_authorized }}
subcommand: ${{ steps.check.outputs.subcommand }}
pytest_args: ${{ steps.check.outputs.pytest_args }}
steps:
- name: Authorize and parse command
id: check
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const commenter = context.payload.comment.user.login;
const { data: permission } = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: commenter
});
const authorized = ['admin', 'write'].includes(permission.permission);
console.log(`User ${commenter}: permission=${permission.permission}, authorized=${authorized}`);
core.setOutput('is_authorized', authorized);
const body = context.payload.comment.body;
const firstLine = body.split('\n')[0];
let subcommand = 'unknown';
let pytestArgs = '';
if (firstLine.startsWith('/diffusers-bot pytest')) {
subcommand = 'pytest';
pytestArgs = firstLine.replace('/diffusers-bot pytest', '').trim();
} else if (body.includes('/diffusers-bot style')) {
subcommand = 'style';
} else if (body.includes('/diffusers-bot review')) {
subcommand = 'review';
}
console.log(`Subcommand: ${subcommand}, pytestArgs: ${pytestArgs}`);
core.setOutput('subcommand', subcommand);
core.setOutput('pytest_args', pytestArgs);
# ── Dispatch to sub-workflows ────────────────────────────────────────────────
style:
needs: authorize
if: |
needs.authorize.outputs.subcommand == 'style' &&
needs.authorize.outputs.is_authorized == 'true' &&
github.event_name == 'issue_comment'
permissions:
contents: read
pull-requests: write
uses: ./.github/workflows/bot_style.yml
secrets:
HF_BOT_STYLE_APP_ID: ${{ secrets.HF_BOT_STYLE_APP_ID }}
HF_BOT_STYLE_SECRET_PEM: ${{ secrets.HF_BOT_STYLE_SECRET_PEM }}
review:
needs: authorize
if: |
needs.authorize.outputs.subcommand == 'review' &&
needs.authorize.outputs.is_authorized == 'true'
permissions:
contents: read
uses: ./.github/workflows/bot_review.yml
secrets:
SERGE_WEBHOOK_SECRET: ${{ secrets.SERGE_WEBHOOK_SECRET }}
SERGE_INSTALLATION_ID: ${{ secrets.SERGE_INSTALLATION_ID }}
pytest:
needs: authorize
if: |
needs.authorize.outputs.subcommand == 'pytest' &&
needs.authorize.outputs.is_authorized == 'true' &&
github.event_name == 'issue_comment'
permissions:
contents: read
pull-requests: write
uses: ./.github/workflows/bot_pytest.yml
with:
pytest_args: ${{ needs.authorize.outputs.pytest_args }}