diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..2794417 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/backend/api/requirements.txt" + schedule: + interval: "weekly" + - package-ecosystem: "pip" + directory: "/backend/gateway/requirements.txt" + schedule: + interval: "weekly" + - package-ecosystem: "npm" + directory: "/frontend/package-lock.json" + schedule: + interval: "weekly" diff --git a/.github/workflows/dependabot-issue-creator.yml b/.github/workflows/dependabot-issue-creator.yml new file mode 100644 index 0000000..39fa2ac --- /dev/null +++ b/.github/workflows/dependabot-issue-creator.yml @@ -0,0 +1,43 @@ +name: Dependabot Issue Creator + +on: + pull_request: + types: + - opened + - synchronize + +jobs: + create_issue: + runs-on: ubuntu-latest + steps: + - name: Debug event + run: echo "${{ toJson(github.event) }}" + + - name: Create issue + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const pr = context.payload.pull_request; + if (!pr) { + core.setFailed('No pull request found in context payload.'); + return; + } + console.log('Pull Request:', pr); + + const { title, html_url, number } = pr; + const issueTitle = `Dependency update: ${title}`; + const issueBody = `A new dependency update PR [#${number}](${html_url}) has been created. Please review and merge if appropriate.`; + + console.log('Creating issue with title:', issueTitle); + console.log('Creating issue with body:', issueBody); + + const issue = await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: issueTitle, + body: issueBody + }); + + console.log('Issue created:', issue.data.html_url); + core.setOutput('issue_url', issue.data.html_url); diff --git a/backend/api/requirements.txt b/backend/api/requirements.txt index 70505ea..3c3cdb6 100644 --- a/backend/api/requirements.txt +++ b/backend/api/requirements.txt @@ -4,3 +4,4 @@ aiohttp==3.8.4 pydantic==1.10.7 redis==4.5.4 uvicorn==0.22.0 +requests==2.26.0