From 6ac272cf5a7243f01eb63eb22f4a1e681f55a0e6 Mon Sep 17 00:00:00 2001 From: bethbeza Date: Fri, 13 Dec 2024 19:34:52 -0500 Subject: [PATCH] both files --- .github/workflows/dependabot-scheduler.yml | 47 +++++++++++++++++++++ update-dependencies.yml | 49 ++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 .github/workflows/dependabot-scheduler.yml create mode 100644 update-dependencies.yml diff --git a/.github/workflows/dependabot-scheduler.yml b/.github/workflows/dependabot-scheduler.yml new file mode 100644 index 00000000000..7d9d55a72ea --- /dev/null +++ b/.github/workflows/dependabot-scheduler.yml @@ -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 }} diff --git a/update-dependencies.yml b/update-dependencies.yml new file mode 100644 index 00000000000..6e4c44286f5 --- /dev/null +++ b/update-dependencies.yml @@ -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