From 135bb7ef921f31bf49506f58d3072d6bc4d0b5f8 Mon Sep 17 00:00:00 2001
From: "datacap-bot[bot]" <157718763+datacap-bot[bot]@users.noreply.github.com>
Date: Thu, 18 Apr 2024 13:53:15 +0000
Subject: [PATCH] first commit

---
 .../issue-modification-to-pr-update.yml       | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 .github/workflows/issue-modification-to-pr-update.yml

diff --git a/.github/workflows/issue-modification-to-pr-update.yml b/.github/workflows/issue-modification-to-pr-update.yml
new file mode 100644
index 0000000..bfc04a3
--- /dev/null
+++ b/.github/workflows/issue-modification-to-pr-update.yml
@@ -0,0 +1,24 @@
+name: Update PR from Issue Modification
+
+on:
+  issues:
+    types:
+      - edited
+
+jobs:
+  convert-issue-to-pr:
+    runs-on: ubuntu-latest
+    env:
+      BACKEND_URL: https://fp-core-prod.dp04sa0tdc6pk.us-east-1.cs.amazonlightsail.com
+    steps:
+      - name: Check out code
+        uses: actions/checkout@v2
+
+      - name: Convert Issue To PR
+        run: |
+          REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)
+          echo "Updating PR from Issue: ${{ github.event.issue.number }} in $REPO_NAME"
+          curl --header "Content-Type: application/json" \
+               --request POST \
+               --data '{"issue_number": "'${{ github.event.issue.number }}'", "repo": "'$REPO_NAME'", "owner": "'${{ github.repository_owner }}'"}' \
+               "${BACKEND_URL}/application/update-from-issue"