Skip to content

Commit

Permalink
both files
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 14, 2024
1 parent eb775c4 commit 6ac272c
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/dependabot-scheduler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Automate Dependency Updates

on:
push:
branches:
- "dependabot/*"

jobs:
update-dependencies:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create a new branch
run: |
git checkout -b update-branch
git push origin update-branch
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PAT_TOKEN }}
branch: update-branch
title: "Automated Dependency Updates"
body: "Automated dependency updates from GitHub Actions."
base: main
commit-message: "Update dependencies"

- name: Merge Pull Request
uses: actions/github-script@v6
with:
script: |
const prNumber = context.payload.pull_request.number;
await github.pulls.merge({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
merge_method: "squash"
});
github-token: ${{ secrets.PAT_TOKEN }}
49 changes: 49 additions & 0 deletions update-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

name: Automate Dependency Updates

on:
push:
branches:
- "dependabot/*"

jobs:
update-dependencies:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create a new branch
run: |
git checkout -b update-branch
git push origin update-branch
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PAT_TOKEN }}
branch: update-branch
title: "Automated Dependency Updates"
body: "Automated dependency updates from GitHub Actions."
base: main
commit-message: "Update dependencies"

- name: Merge Pull Request
uses: actions/github-script@v6
with:
script: |
const prNumber = context.payload.pull_request.number;
await github.pulls.merge({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
merge_method: "squash"
});
f github-token: ${{ secrets.PAT_TOKEN }}
:wq

0 comments on commit 6ac272c

Please sign in to comment.