Skip to content

ci: prevent command injection in prevent-deletion workflow#22928

Merged
ti-chi-bot[bot] merged 2 commits into
pingcap:masterfrom
Oreoxmt:fix-prevent-deletion
May 26, 2026
Merged

ci: prevent command injection in prevent-deletion workflow#22928
ti-chi-bot[bot] merged 2 commits into
pingcap:masterfrom
Oreoxmt:fix-prevent-deletion

Conversation

@Oreoxmt
Copy link
Copy Markdown
Collaborator

@Oreoxmt Oreoxmt commented May 26, 2026

First-time contributors' checklist

What is changed, added or deleted? (Required)

ci: prevent command injection in prevent-deletion workflow

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@Oreoxmt Oreoxmt self-assigned this May 26, 2026
@Oreoxmt Oreoxmt added translation/no-need No need to translate this PR. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. labels May 26, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@ti-chi-bot ti-chi-bot Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 26, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the prevent-deletion GitHub Actions workflow (runs on pull_request_target) to reduce injection risk when handling pull request–provided values, and to generate check-run payloads more safely.

Changes:

  • Quote PR-provided values by routing them through environment variables for git/curl usage.
  • Replace echo-constructed JSON with jq -n JSON generation for the check-run payload.
  • Adjust checkout/fetch behavior to ensure the head commit can be diffed reliably.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/prevent-deletion.yaml Outdated
Comment thread .github/workflows/prevent-deletion.yaml Outdated
Co-authored-by: Aolin <aolinz@outlook.com>
@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label May 26, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented May 26, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-05-26 05:55:01.214504115 +0000 UTC m=+331571.184669169: ☑️ agreed by qiancai.

@Oreoxmt Oreoxmt added the lgtm label May 26, 2026
@Oreoxmt
Copy link
Copy Markdown
Collaborator Author

Oreoxmt commented May 26, 2026

/approve

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented May 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Oreoxmt

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

The pull request process is described 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

@ti-chi-bot ti-chi-bot Bot added the approved label May 26, 2026
@ti-chi-bot ti-chi-bot Bot merged commit 2a3445e into pingcap:master May 26, 2026
12 checks passed
@ti-chi-bot
Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #22929.
But this PR has conflicts, please resolve them!

@ti-chi-bot
Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #22930.
But this PR has conflicts, please resolve them!

@ti-chi-bot
Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #22931.
But this PR has conflicts, please resolve them!

@ti-chi-bot
Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #22932.

@ti-chi-bot
Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #22933.

@ti-chi-bot
Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created to branch release-6.1: #22934.
But this PR has conflicts, please resolve them!

@Oreoxmt Oreoxmt deleted the fix-prevent-deletion branch May 26, 2026 07:02
Oreoxmt added a commit to ti-chi-bot/docs that referenced this pull request May 26, 2026
Oreoxmt added a commit to ti-chi-bot/docs that referenced this pull request May 26, 2026
Oreoxmt added a commit to ti-chi-bot/docs that referenced this pull request May 26, 2026
Oreoxmt added a commit to ti-chi-bot/docs that referenced this pull request May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. translation/no-need No need to translate this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants