Feedback from qweqweq at 2024-08-26T14:02:41.106Z #1
This file contains 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
name: Process Feedback Issues | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
process-feedback: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Create responses directory if it doesn't exist | |
run: | | |
mkdir -p responses | |
- name: Extract and save feedback | |
run: | | |
ISSUE_TITLE="${{ github.event.issue.title }}" | |
ISSUE_BODY="${{ github.event.issue.body }}" | |
NAME=$(echo "$ISSUE_TITLE" | sed 's/Feedback from //;s/ at.*//') | |
TIMESTAMP=$(echo "$ISSUE_TITLE" | sed 's/.* at //') | |
# Sanitize timestamp for use in filenames | |
TIMESTAMP=${TIMESTAMP//:/-} | |
FILENAME="responses/${NAME}_${TIMESTAMP}.txt" | |
# Save the feedback to a file | |
echo -e "$ISSUE_BODY" > "$FILENAME" | |
# Commit and push the file | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
git add "$FILENAME" | |
git commit -m "Added feedback from $NAME on $TIMESTAMP" | |
git push |