Skip to content

Commit

Permalink
ci(dependabot): no scratch org on dependabot (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
dschach authored Mar 14, 2023
1 parent aea80de commit c8d21dc
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
# Formatting and linting only runs on human-submitted PRs
format-lint-lwc-tests:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
# Checkout the source code
- name: "Checkout source code"
Expand Down Expand Up @@ -42,43 +43,6 @@ jobs:
- name: "Code formatting verification with Prettier"
run: npm run prettier:apex:verify

# Auto merge Dependabot PRs for:
# - patch updates on prod dependencies
# - minor updates on dev dependencies
dependabot-auto-merge:
# Only run for Dependabot PRs
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
needs: format-lint-lwc-tests
permissions:
pull-requests: write
contents: write
steps:
- name: "Fetch Dependabot metadata"
id: dependabot
uses: dependabot/fetch-metadata@v1

- name: "Check auto merge conditions"
id: auto-merge
if: |
(
steps.dependabot.outputs.update-type == 'version-update:semver-patch' &&
contains('direct:production,indirect:production', steps.dependabot.outputs.dependency-type)
) || (
contains('version-update:semver-minor,version-update:semver-patch', steps.dependabot.outputs.update-type) &&
contains('direct:development,indirect:development', steps.dependabot.outputs.dependency-type)
)
run: echo "::notice ::auto-merge conditions satisfied"

- name: "Approve and merge PR"
if: ${{ steps.auto-merge.conclusion == 'success' }}
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --squash "$PR_URL"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}

scratch-org-test:
runs-on: ubuntu-latest
needs: format-lint-lwc-tests
Expand Down

0 comments on commit c8d21dc

Please sign in to comment.