Skip to content

Commit

Permalink
chore: Add Dependabot Configuration with Sync to 'dependentbotchanges…
Browse files Browse the repository at this point in the history
…' Branch (#11)

* edit 1

* edit 2

---------

Co-authored-by: Harmanpreet Kaur <[email protected]>
  • Loading branch information
Harmanpreet-Microsoft and Harmanpreet Kaur authored Dec 27, 2024
1 parent dcd93f9 commit 086f9b0
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Dependabot configuration file
# For more details, refer to: https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# GitHub Actions dependencies
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 10

- package-ecosystem: "pip"
directory: "/src/backend"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 10

- package-ecosystem: "pip"
directory: "/src/frontend"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 10
44 changes: 44 additions & 0 deletions .github/workflows/sync-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Sync Main to dependabotchanges

on:
# Schedule the sync job to run daily or customize as needed
schedule:
- cron: '0 1 * * *' # Runs every day at 1 AM UTC
# Trigger the sync job on pushes to the main branch
push:
branches:
- main

jobs:
sync:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for accurate branch comparison

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Sync main to dependabotchanges
run: |
# Ensure we're on the main branch
git checkout main
# Fetch the latest changes
git pull origin main
# Switch to dependabotchanges branch
git checkout dependabotchanges
# Merge main branch changes
git merge main --no-edit
# Push changes back to dependabotchanges1 branch
git push origin dependabotchanges
- name: Notify on Failure
if: failure()
run: echo "Sync from main to dependabotchanges failed!"

0 comments on commit 086f9b0

Please sign in to comment.