From f54d949d40c56a594e8d90ebee1bb8d2fb157b60 Mon Sep 17 00:00:00 2001 From: Corey Carvalho <44616801+coreycarvalho@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:52:18 -0500 Subject: [PATCH] wip --- .../notify-dependency-update-template.md | 8 ---- .../workflows/dependency-ticket-creation.yml | 42 +++++++++++++++++++ 2 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/dependency-ticket-creation.yml diff --git a/.github/ISSUE_TEMPLATE/notify-dependency-update-template.md b/.github/ISSUE_TEMPLATE/notify-dependency-update-template.md index 23ad734416..b912916a9f 100644 --- a/.github/ISSUE_TEMPLATE/notify-dependency-update-template.md +++ b/.github/ISSUE_TEMPLATE/notify-dependency-update-template.md @@ -1,11 +1,3 @@ ---- -name: Notify Dependency Update Template -about: Regular dependency updates -title: Regular Update for Dependencies -labels: Notify, QA, Tech Debt -assignees: '' ---- - ## User Story - Business Need We wish to keep dependencies up to date so that we do not need such massive overhauls of our system. This is a recurring task to update all dependencies we are able to update. Any conflicts shall get a dedicated ticket. This task should be a day of work at most because it only updates non-breaking changes. diff --git a/.github/workflows/dependency-ticket-creation.yml b/.github/workflows/dependency-ticket-creation.yml new file mode 100644 index 0000000000..b4290937b6 --- /dev/null +++ b/.github/workflows/dependency-ticket-creation.yml @@ -0,0 +1,42 @@ +name: Biweekly Dependency Ticket Creation + +on: + push: + branches: + - "1381-dependency-ticket-automation" + +jobs: + create_issue: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Check for Existing Issue + id: check_issue + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if gh issue list --state open --json title -q '.[] | select(.title == "Regular Update for Dependencies")' | grep -q "Regular Update for Dependencies"; then + echo "issue_exists=true" >> $GITHUB_ENV + else + echo "issue_exists=false" >> $GITHUB_ENV + fi + + - name: Create GitHub Issue + if: env.issue_exists == 'false' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + ISSUE_URL=$(gh issue create \ + --body-file "./.github/ISSUE_TEMPLATE/notify-dependency-update-template.md" \ + --label "Notify" \ + --label "QA" \ + --label "Tech Debt" \ + --title "Regular Update for Dependencies") + + echo "issue_url=${ISSUE_URL}" >> $GITHUB_ENV + + - name: Print Message if Issue Exists + if: env.issue_exists == 'true' + run: echo "Ticket already exists"