-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41a60ee
commit 3aef146
Showing
5 changed files
with
58 additions
and
46 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 |
---|---|---|
@@ -1,42 +1,48 @@ | ||
# Based on https://github.com/spatie/package-skeleton-laravel/blob/main/.github/workflows/dependabot-auto-merge.yml | ||
# Copied from https://github.com/spatie/package-skeleton-laravel/blob/main/.github/workflows/dependabot-auto-merge.yml | ||
# See https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request | ||
name: dependabot-auto-merge | ||
on: | ||
pull_request_target: | ||
types: [opened, reopened] | ||
|
||
# We're using pull_request_target instead of pull_request due to permission issues with the pull_request target: | ||
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#responding-to-events | ||
on: pull_request_target | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
jobs: | ||
dependabot: | ||
name: "Dependabot auto-merge" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
|
||
steps: | ||
- name: "Dependabot metadata" | ||
id: dependabot-metadata | ||
# https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#fetch-metadata-about-a-pull-request | ||
id: metadata | ||
uses: dependabot/[email protected] | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: "Output updated dependencies (JSON)" | ||
run: echo steps.dependabot-metadata.outputs.updated-dependencies-json | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: "Auto-merge Dependabot PRs for semver-minor updates" | ||
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}} | ||
run: gh pr merge --auto --squash "$PR_URL" | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
# does not work, see https://github.com/dependabot/fetch-metadata/issues/499 | ||
# - name: "Auto-merge Dependabot PRs for semver-minor updates" | ||
# if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' }} | ||
# run: gh pr merge --auto --rebase "$PR_URL" | ||
# env: | ||
# PR_URL: "${{ github.event.pull_request.html_url }}" | ||
# github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
# | ||
# - name: "Auto-merge Dependabot PRs for semver-patch updates" | ||
# if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }} | ||
# run: gh pr merge --auto --rebase "$PR_URL" | ||
# env: | ||
# PR_URL: "${{ github.event.pull_request.html_url }}" | ||
# github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: "Auto-merge Dependabot PRs for semver-patch updates" | ||
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} | ||
run: gh pr merge --auto --squash "$PR_URL" | ||
- name: "Enable auto-merge" | ||
if: ${{ steps.metadata.outputs.dependency-type == 'direct:development' }} | ||
run: gh pr merge -R "${{ github.repository }}" --squash --auto "${{ github.event.pull_request.number }}" | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
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
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/.idea/ | ||
/.phpunit.cache/ | ||
/build/ | ||
/build/* | ||
!/build/rector/ | ||
/vendor/ | ||
/.php-cs-fixer.cache | ||
/composer.lock | ||
|
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
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