Skip to content

Commit

Permalink
Implement workflow to automatically create dependency update tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
coreycarvalho committed Nov 4, 2024
1 parent eae4afb commit e927ac6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
8 changes: 0 additions & 8 deletions .github/ISSUE_TEMPLATE/notify-dependency-update-template.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/dependency-ticket-creation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Biweekly Dependency Ticket Creation

on:
schedule:
- cron: "0 13 */14 * 1" # Runs every two weeks on Monday at 09:00 ET (which is 13:00 UTC)

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"

0 comments on commit e927ac6

Please sign in to comment.