Skip to content

Emit warning for pull_request_target trigger usage#410

Merged
stefanzweifel merged 2 commits into
masterfrom
pull_request_target-warning
Jun 27, 2026
Merged

Emit warning for pull_request_target trigger usage#410
stefanzweifel merged 2 commits into
masterfrom
pull_request_target-warning

Conversation

@stefanzweifel

Copy link
Copy Markdown
Owner

This pull request adds a new security warning to alert users when the action is triggered by a pull_request_target event, which can expose repository secrets. It also introduces an input to suppress this warning if desired, updates documentation to clarify the risks, and adds tests to verify the new behavior.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a security-focused warning when the action is executed under the pull_request_target event (where secrets exposure risk is higher), along with an opt-out input, documentation updates, and test coverage to validate the behavior.

Changes:

  • Emit a ::warning:: annotation when GITHUB_EVENT_NAME=pull_request_target, with an input to suppress it.
  • Document the pull_request_target risk and the new suppression input in the README’s pull_request_target section.
  • Add BATS tests to verify warning emission/suppression and prevent environment leakage across test runs.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
entrypoint.sh Adds the pull_request_target detection and warning emission (with suppression input).
action.yml Introduces disable_pull_request_target_trigger_warning input.
README.md Expands pull_request_target documentation and explains the new warning + suppression input.
tests/git-auto-commit.bats Adds tests for warning behavior and unsets GITHUB_EVENT_NAME in setup for isolation.

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

Comment thread README.md
@stefanzweifel
stefanzweifel merged commit c365a74 into master Jun 27, 2026
2 checks passed
@stefanzweifel
stefanzweifel deleted the pull_request_target-warning branch June 27, 2026 12:33
ajgon pushed a commit to deedee-ops/schemas that referenced this pull request Jun 28, 2026
… (v7.1.0 ➔ v7.2.0) (#6)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) | action | minor | `v7.1.0` → `v7.2.0` |

---

### Release Notes

<details>
<summary>stefanzweifel/git-auto-commit-action (stefanzweifel/git-auto-commit-action)</summary>

### [`v7.2.0`](https://github.com/stefanzweifel/git-auto-commit-action/blob/HEAD/CHANGELOG.md#v720---2026-06-28)

[Compare Source](stefanzweifel/git-auto-commit-action@v7.1.0...v7.2.0)

##### Added

- Add hooks to run shell snippets around git operations ([#&#8203;411](stefanzweifel/git-auto-commit-action#411)) [@&#8203;stefanzweifel](https://github.com/@&#8203;stefanzweifel)
- Emit warning for pull\_request\_target trigger usage ([#&#8203;410](stefanzweifel/git-auto-commit-action#410)) [@&#8203;stefanzweifel](https://github.com/@&#8203;stefanzweifel)

##### Fixed

- docs(action): fix input and output descriptions in action.yml ([#&#8203;406](stefanzweifel/git-auto-commit-action#406)) [@&#8203;kranthipoturaju](https://github.com/@&#8203;kranthipoturaju)
- docs: fix typos, grammar, and formatting across markdown files ([#&#8203;408](stefanzweifel/git-auto-commit-action#408)) [@&#8203;kranthipoturaju](https://github.com/@&#8203;kranthipoturaju)
- docs: fix broken and redirecting URLs in README.md ([#&#8203;407](stefanzweifel/git-auto-commit-action#407)) [@&#8203;kranthipoturaju](https://github.com/@&#8203;kranthipoturaju)
- README: clearify meaning of the repository field ([#&#8203;404](stefanzweifel/git-auto-commit-action#404)) [@&#8203;gucio321](https://github.com/@&#8203;gucio321)

##### Dependency Updates

- Bump actions/checkout from 6 to 7 ([#&#8203;409](stefanzweifel/git-auto-commit-action#409)) \[@&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot)]\(<https://github.com/@&#8203;[dependabot[bot>]]\(<https://github.com/apps/dependabot>))
- Bump release-drafter/release-drafter from 6 to 7 ([#&#8203;403](stefanzweifel/git-auto-commit-action#403)) \[@&#8203;[dependabot\[bot\]](https://github.com/apps/dependabot)]\(<https://github.com/@&#8203;[dependabot[bot>]]\(<https://github.com/apps/dependabot>))

</details>

---

### Configuration

📅 **Schedule**: (in timezone Europe/Warsaw)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDUuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI0NS4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

Reviewed-on: https://git.ajgon.casa/deedee/schemas/pulls/6
@clxmstaab

Copy link
Copy Markdown
Contributor

nice - thank you!

@stefanzweifel

stefanzweifel commented Jun 29, 2026

Copy link
Copy Markdown
Owner Author

@clxmstaab You're welcome. I even thought about completely blocking the action when used through this trigger, but I know there are legitimate reasons why someone would use the trigger. Plus that would be another major release.

A warning should suffice for now.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants