Skip to content

Workflow: harden PR helper#5

Merged
mdheller merged 1 commit intomainfrom
workflow/harden-pr-helper
Feb 12, 2026
Merged

Workflow: harden PR helper#5
mdheller merged 1 commit intomainfrom
workflow/harden-pr-helper

Conversation

@mdheller
Copy link
Member

Make scripts/pr.sh safe: refuse nested repos, avoid git add -A, allow optional path args; default to git add -u.

@mdheller mdheller merged commit a504085 into main Feb 12, 2026
5 checks passed
@mdheller mdheller deleted the workflow/harden-pr-helper branch February 12, 2026 01:08
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f0e4e289f9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

fi

# Guard: refuse to run if there are nested git repos (prevents submodule/gitlink accidents)
if find . -mindepth 2 -maxdepth 6 -name .git -type d | grep -q .; then

Choose a reason for hiding this comment

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

P2 Badge Detect .git files when guarding nested repos

The new safety guard only searches for .git directories (find ... -name .git -type d), but Git submodules and linked worktrees use a .git file, so this check silently misses the common nested-repo case it is meant to block. In repositories that include submodules, the script will continue and can still stage gitlink updates via git add -u, which undermines the hardening goal and can lead to accidental submodule pointer commits.

Useful? React with 👍 / 👎.

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.

1 participant