Skip to content

Commit

Permalink
Create process-issues.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
UwUtisum authored Aug 26, 2024
1 parent f77b855 commit 7ccbd54
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/process-issues.yml
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

0 comments on commit 7ccbd54

Please sign in to comment.