From 7ccbd5428a5a2cd544cee4270c916ea5557a2c8c Mon Sep 17 00:00:00 2001 From: UwUtisum <35628281+UwUtisum@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:00:44 +0100 Subject: [PATCH] Create process-issues.yml --- .github/workflows/process-issues.yml | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/process-issues.yml diff --git a/.github/workflows/process-issues.yml b/.github/workflows/process-issues.yml new file mode 100644 index 0000000..681379a --- /dev/null +++ b/.github/workflows/process-issues.yml @@ -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 "actions@github.com" + git add "$FILENAME" + git commit -m "Added feedback from $NAME on $TIMESTAMP" + git push