mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-20 02:15:12 +00:00
- Introduced hooks to enable automated workflows triggered by specific events during GitHub Copilot sessions. - Added documentation for hooks in AGENTS.md and README.md. - Created a new directory structure for hooks, including README.md and hooks.json files. - Implemented two example hooks: Session Auto-Commit and Session Logger. - Developed scripts for logging session events and auto-committing changes. - Enhanced validation and parsing for hook metadata. - Updated build and validation scripts to accommodate new hooks functionality.
25 lines
534 B
Bash
Executable File
25 lines
534 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Log user prompt submission
|
|
|
|
set -euo pipefail
|
|
|
|
# Skip if logging disabled
|
|
if [[ "${SKIP_LOGGING:-}" == "true" ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
# Read input from Copilot (contains prompt info)
|
|
INPUT=$(cat)
|
|
|
|
# Create logs directory if it doesn't exist
|
|
mkdir -p logs/copilot
|
|
|
|
# Extract timestamp
|
|
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
|
|
# Log prompt (you can parse INPUT for more details)
|
|
echo "{\"timestamp\":\"$TIMESTAMP\",\"event\":\"userPromptSubmitted\",\"level\":\"${LOG_LEVEL:-INFO}\"}" >> logs/copilot/prompts.log
|
|
|
|
exit 0
|