Skip to content

Dependency Updater: core #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions .github/workflows/dependency-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v5
with:
Expand All @@ -32,18 +34,22 @@ jobs:

# Check if a PR already exists for the package
if gh pr list --state open | grep -q "${pr_name}"; then
echo "Pr for $dirpath already exists. Skipping."
else
# Create PR
branch_name="dependency-updater-$dirpath"
git checkout -b "$branch_name"
git add "$file"
git commit -m "chore: dependency update"
git push --set-upstream origin "$branch_name"
echo $(git status)
gh pr create --title "$pr_name" --body "Automated dependency update" --base "main"
git checkout main
sleep 30 # prevent rate limit.
fi
echo "Pr for $dirpath already exists. Deleting old PR."
pr_number=$(gh pr list --state open --json number --search "$pr_name" -q '.[0].number')
gh pr close "$pr_number" --delete-branch

fi

# Create PR
branch_name="dependency-updater-$dirpath-${{ github.run_id }}"
git checkout -b "$branch_name"
git add "$file"
git commit -m "chore: dependency update"
git push --set-upstream origin "$branch_name"
echo $(git status)
gh pr create --title "$pr_name" --body "Automated dependency update" --base "main"
git checkout main
sleep 30 # prevent rate limit.

done

Loading
Loading