-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
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 |