Skip to content

ci: add allow-unsafe-pr-checkout option to checkout steps - #228

Open
asterwyx wants to merge 1 commit into
linuxdeepin:masterfrom
asterwyx:master
Open

ci: add allow-unsafe-pr-checkout option to checkout steps#228
asterwyx wants to merge 1 commit into
linuxdeepin:masterfrom
asterwyx:master

Conversation

@asterwyx

@asterwyx asterwyx commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Add allow-unsafe-pr-checkout: true to both source and dest repository
checkout steps in synchronize workflow.

在同步工作流的源仓库和目标仓库 checkout 步骤中添加
allow-unsafe-pr-checkout: true 配置项。

Log: 同步工作流checkout步骤添加unsafe-pr-checkout选项
Influence: 允许在PR事件触发时安全检出仓库,确保同步流程正常运行。

Summary by Sourcery

Enable pull request checkout support in the synchronization workflow for both source and destination repositories.

Enhancements:

  • Allow the synchronization workflow to check out source and destination repositories for pull request-triggered runs.

CI:

  • Enable unsafe pull request checkout handling for both repository checkout steps in the synchronization workflow.

Add allow-unsafe-pr-checkout: true to both source and dest repository
checkout steps in synchronize workflow.

在同步工作流的源仓库和目标仓库 checkout 步骤中添加
allow-unsafe-pr-checkout: true 配置项。

Log: 同步工作流checkout步骤添加unsafe-pr-checkout选项
Influence: 允许在PR事件触发时安全检出仓库,确保同步流程正常运行。
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from asterwyx. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The synchronization workflow now passes allow-unsafe-pr-checkout: true to both source and destination checkout actions, allowing repository checkout to proceed correctly when the workflow is triggered by pull request events.

Sequence diagram for PR-triggered repository synchronization

sequenceDiagram
    participant Workflow as SynchronizeWorkflow
    participant SourceRepo as SourceRepository
    participant DestRepo as DestinationRepository

    Workflow->>SourceRepo: actions/checkout@v3 allow-unsafe-pr-checkout: true
    SourceRepo-->>Workflow: Source checkout
    Workflow->>DestRepo: actions/checkout@v3 allow-unsafe-pr-checkout: true
    DestRepo-->>Workflow: Destination checkout
    Workflow->>Workflow: rsync
Loading

File-Level Changes

Change Details Files
Enable unsafe pull-request checkout handling for both repositories used by the synchronization workflow.
  • Add the checkout option to the source repository step.
  • Add the checkout option to the destination repository step.
.github/workflows/synchronize-to-dtk6.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/synchronize-to-dtk6.yml" line_range="36" />
<code_context>
           path: 'source'
           repository: ${{ inputs.source_repo }}
           fetch-depth: 0
+          allow-unsafe-pr-checkout: true

       - name: Checkout dest repository ${{ inputs.dest_repo }}
</code_context>
<issue_to_address>
**issue (bug_risk):** `actions/checkout@v3` does not define an `allow-unsafe-pr-checkout` input, so the runner ignores these settings and only emits an unexpected-input warning; the workflow therefore does not gain the PR checkout behavior described in the change.

**Triggers:** When the synchronization workflow depends on this option to checkout a pull-request ref.

**Suggested fix:** Use an actions/checkout version and configuration that explicitly supports the required PR checkout behavior, or remove this unsupported input and implement the supported equivalent.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

path: 'source'
repository: ${{ inputs.source_repo }}
fetch-depth: 0
allow-unsafe-pr-checkout: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): actions/checkout@v3 does not define an allow-unsafe-pr-checkout input, so the runner ignores these settings and only emits an unexpected-input warning; the workflow therefore does not gain the PR checkout behavior described in the change.

Triggers: When the synchronization workflow depends on this option to checkout a pull-request ref.

Suggested fix: Use an actions/checkout version and configuration that explicitly supports the required PR checkout behavior, or remove this unsupported input and implement the supported equivalent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants