Skip to content

Commit 15f5b15

Browse files
committed
Allow docker agent to request reviews
Signed-off-by: Derek Misler <derek.misler@docker.com>
1 parent 956bbc7 commit 15f5b15

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ runs:
192192
ACTION_PATH: ${{ github.action_path }}
193193
# Get author_association from comment events (the main risk)
194194
COMMENT_ASSOCIATION: ${{ github.event.comment.author_association }}
195+
COMMENT_USER_LOGIN: ${{ github.event.comment.user.login }}
196+
COMMENT_USER_TYPE: ${{ github.event.comment.user.type }}
195197
DEBUG: ${{ inputs.debug }}
196198
run: |
197199
# Only enforce auth for comment-triggered events
@@ -202,6 +204,14 @@ runs:
202204
exit 0
203205
fi
204206
207+
# Allow our own GitHub App bot to trigger reviews (e.g., auto-triage posts /review).
208+
# Both login AND type are checked to prevent spoofing by regular accounts.
209+
if [ "$COMMENT_USER_LOGIN" = "docker-agent[bot]" ] && [ "$COMMENT_USER_TYPE" = "Bot" ]; then
210+
echo "ℹ️ Skipping auth check (trusted bot: $COMMENT_USER_LOGIN)"
211+
echo "authorized=bot" >> $GITHUB_OUTPUT
212+
exit 0
213+
fi
214+
205215
echo "Using comment author_association: $COMMENT_ASSOCIATION"
206216
207217
# Allowed roles (hardcoded for security - cannot be overridden)

0 commit comments

Comments
 (0)