Skip to content

Commit

Permalink
Merge pull request #8060 from jrjohnson/more-automerge-updates
Browse files Browse the repository at this point in the history
More Updates to Automerge
  • Loading branch information
dartajax committed Aug 9, 2024
2 parents 5bcb7f8 + 370a9d0 commit 102119a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 66 deletions.
58 changes: 0 additions & 58 deletions .github/workflows/auto-merge.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Dependabot auto-merge
on: pull_request
jobs:
check:
runs-on: ubuntu-latest
name: Determine Automerge Status
if: ${{ github.actor == 'dependabot[bot]' }}
outputs:
shouldMerge: ${{ steps.should_merge.outputs.shouldMerge }}
env:
SAFE_DEPENDENCIES: "@embroider/test-setup,@embroider/util,@formatjs/intl-locale,@formatjs/intl-pluralrules,@formatjs/intl-relativetimeformat,@percy/cli,@percy/ember,@sentry/ember,broccoli-file-creator,broccoli-funnel,broccoli-merge-trees,browserslist,caniuse-db,ember-a11y-testing,ember-cli-bundle-analyzer,ember-cli-dependency-checker,ember-cli-dependency-lint,ember-cli-deprecation-workflow,ember-mirage,ember-cli-page-object,ember-noscript,ember-qunit-nice-errors,ember-template-lint,ember-test-selectors,stylelint-config-recommended-scss,stylelint-scss"
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2.2.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: >
npx in-string-list ${{ steps.metadata.outputs.dependency-names }} ${{ env.SAFE_DEPENDENCIES }}
&& echo "isSafe=yes" >> "$GITHUB_OUTPUT"
- run: >
${{ steps.metadata.outputs.update-type }} != 'version-update:semver-major'
&& echo "isNotMajor=yes" >> "$GITHUB_OUTPUT"
- id: should_merge
run: (test -z {{env.isSafe}} && test -z {{env.isNotMajor}}) && echo "shouldMerge=yes" >> "$GITHUB_OUTPUT"
auto_merge:
runs-on: ubuntu-latest
needs: check
if: needs.check.outputs.shouldMerge == 'yes'
name: Approve, label, and merge
steps:
- uses: actions/checkout@v4
- run: |
gh pr merge --merge --auto ${{ github.event.number }}
gh pr edit --add-label "ready to merge" ${{ github.event.number }}
gh pr review --approve -b "Auto Approved" ${{ github.event.number }}
env:
GH_TOKEN: ${{ secrets.ZORGBORT_TOKEN }}
12 changes: 4 additions & 8 deletions .github/workflows/update-transitive-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,14 @@ jobs:
[1]: https://github.com/peter-evans/create-pull-request
branch: auto-update-dependencies
labels: dependencies,run percy tests
- name: Add Ready Label
if: steps.cpr.outputs.pull-request-operation == 'created'
run: gh pr edit --add-label "ready to merge" ${{ steps.cpr.outputs.pull-request-number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Approve Pull Request
if: steps.cpr.outputs.pull-request-operation == 'created'
run: gh pr review --approve -b "Auto Approved" ${{ steps.cpr.outputs.pull-request-number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable Pull Request Automerge
- name: Enable Pull Request Automerge and Label for Tests
if: steps.cpr.outputs.pull-request-operation == 'created'
run: gh pr merge --merge --auto ${{ steps.cpr.outputs.pull-request-number }}
run: |
gh pr edit --add-label "ready to merge" ${{ steps.cpr.outputs.pull-request-number }}
gh pr merge --merge --auto ${{ steps.cpr.outputs.pull-request-number }}
env:
GH_TOKEN: ${{ secrets.ZORGBORT_TOKEN }}

0 comments on commit 102119a

Please sign in to comment.