generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding basic implementation to be refined
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
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 }} | ||
|