Emit warning for pull_request_target trigger usage#410
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 whenGITHUB_EVENT_NAME=pull_request_target, with an input to suppress it. - Document the
pull_request_targetrisk and the new suppression input in the README’spull_request_targetsection. - 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.
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 ([#​411](stefanzweifel/git-auto-commit-action#411)) [@​stefanzweifel](https://github.com/@​stefanzweifel) - Emit warning for pull\_request\_target trigger usage ([#​410](stefanzweifel/git-auto-commit-action#410)) [@​stefanzweifel](https://github.com/@​stefanzweifel) ##### Fixed - docs(action): fix input and output descriptions in action.yml ([#​406](stefanzweifel/git-auto-commit-action#406)) [@​kranthipoturaju](https://github.com/@​kranthipoturaju) - docs: fix typos, grammar, and formatting across markdown files ([#​408](stefanzweifel/git-auto-commit-action#408)) [@​kranthipoturaju](https://github.com/@​kranthipoturaju) - docs: fix broken and redirecting URLs in README.md ([#​407](stefanzweifel/git-auto-commit-action#407)) [@​kranthipoturaju](https://github.com/@​kranthipoturaju) - README: clearify meaning of the repository field ([#​404](stefanzweifel/git-auto-commit-action#404)) [@​gucio321](https://github.com/@​gucio321) ##### Dependency Updates - Bump actions/checkout from 6 to 7 ([#​409](stefanzweifel/git-auto-commit-action#409)) \[@​[dependabot\[bot\]](https://github.com/apps/dependabot)]\(<https://github.com/@​[dependabot[bot>]]\(<https://github.com/apps/dependabot>)) - Bump release-drafter/release-drafter from 6 to 7 ([#​403](stefanzweifel/git-auto-commit-action#403)) \[@​[dependabot\[bot\]](https://github.com/apps/dependabot)]\(<https://github.com/@​[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
Contributor
|
nice - thank you! |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds a new security warning to alert users when the action is triggered by a
pull_request_targetevent, 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.