From 27266b14aa57b3a56a44789aff2ee9e91b083a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Tue, 26 Mar 2024 10:34:07 -0700 Subject: [PATCH 1/2] Match automerge with -server --- .github/dependabot.yml | 4 ++-- .../{dependabot-automerge.yml => automerge.yml} | 10 ++-------- .github/workflows/cicd.yml | 10 +++------- 3 files changed, 7 insertions(+), 17 deletions(-) rename .github/workflows/{dependabot-automerge.yml => automerge.yml} (58%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 69fb82763..f5e6783a8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,7 @@ updates: allow: - dependency-type: "all" schedule: - interval: weekly + interval: "weekly" open-pull-requests-limit: 10 labels: - "Task" @@ -16,6 +16,6 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: weekly + interval: "weekly" labels: - "Task" diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/automerge.yml similarity index 58% rename from .github/workflows/dependabot-automerge.yml rename to .github/workflows/automerge.yml index 3bd50c3ea..054be53ac 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/automerge.yml @@ -12,20 +12,14 @@ jobs: runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} + if: ${{ contains('["dependabot[bot]", "pre-commit-ci[bot]"]', github.actor) }} steps: - - name: Get Dependabot metadata - id: dependabot-metadata - uses: dependabot/fetch-metadata@v1.6.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Approve the PR run: gh pr review --approve "${{ github.event.pull_request.html_url }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Enable auto-merge - run: gh pr merge --merge --auto "${{ github.event.pull_request.html_url }}" + run: gh pr merge --squash --auto "${{ github.event.pull_request.html_url }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 91a9416e7..6ff837d43 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -1,5 +1,4 @@ -# Docs: -# https://help.github.com/en/actions/automating-your-workflow-with-github-actions +# Docs: https://docs.github.com/en/actions name: CI/CD @@ -47,9 +46,6 @@ jobs: - name: Build application run: npm run build - env: - # Disable warnings due to https://github.com/twbs/bootstrap/pull/36258 - CI: "false" - name: Run unit tests run: npm test -- --ci --watchAll=false --coverage @@ -99,7 +95,7 @@ jobs: mkdir images; docker image save ranger-ims-web:dev | gzip -6 > images/web.tgz; - - name: Upload Docker image artifact + - name: Upload Docker image artifacts uses: actions/upload-artifact@v4 with: name: images @@ -126,7 +122,7 @@ jobs: - name: Checkout source code uses: actions/checkout@v4 - - name: Download Docker image artifact + - name: Download Docker image artifacts uses: actions/download-artifact@v4 with: name: images From ba2da3d94ebccfa3cbda89e3565ebb559d8514f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20Sa=CC=81nchez?= Date: Tue, 26 Mar 2024 10:47:20 -0700 Subject: [PATCH 2/2] Add autoupdate --- .github/workflows/autoupdate.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/autoupdate.yaml diff --git a/.github/workflows/autoupdate.yaml b/.github/workflows/autoupdate.yaml new file mode 100644 index 000000000..6f8e1f1d7 --- /dev/null +++ b/.github/workflows/autoupdate.yaml @@ -0,0 +1,20 @@ +name: Update branch for PRs that are passing and approved for merging + +on: + schedule: + - cron: "0 4 * * *" # Daily at 4am + +jobs: + update-branches: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Update branches + uses: brainly/action-autoupdate-branch@2.1.1 + id: autoUpdateBranch + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + requiredPassedChecks: 1 + requiredApprovals: 1 + update-limits: 2