-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from imponeer/improvement/Automerge-dependabot-…
…pull-requests Automerge dependabot pull requests
- Loading branch information
Showing
2 changed files
with
77 additions
and
45 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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: On pull request | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
continue-on-error: false | ||
strategy: | ||
max-parallel: 3 | ||
matrix: | ||
composer: | ||
- 1 | ||
- 2 | ||
php: | ||
- 7.1 | ||
- 7.2 | ||
- 7.3 | ||
- 7.4 | ||
- 8.0 | ||
- 8.1 | ||
name: Test - php:${{ matrix.php }}; composer:${{ matrix.composer }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Install PHP | ||
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: curl, gd, pdo_mysql, json, mbstring, pcre, session | ||
ini-values: post_max_size=256M | ||
coverage: none | ||
tools: composer:v${{ matrix.composer }} | ||
- name: Composer validate | ||
run: composer validate --strict --no-check-lock | ||
- name: Install Composer dependencies (with dev) | ||
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader | ||
- name: Install Composer dependencies (without dev) | ||
run: composer install --no-progress --no-dev --no-suggest --prefer-dist --optimize-autoloader | ||
|
||
dependabot: | ||
needs: tests | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
runs-on: ubuntu-latest | ||
# Checking the actor will prevent your Action run failing on non-Dependabot | ||
# PRs but also ensures that it only does work for Dependabot PRs. | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
# This first step will fail if there's no metadata and so the approval | ||
# will not occur. | ||
- name: Dependabot metadata | ||
id: dependabot-metadata | ||
uses: dependabot/[email protected] | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
# Here the PR gets approved. | ||
- name: Approve a PR | ||
run: gh pr review --approve "$PR_URL" | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Finally, this sets the PR to allow auto-merging for patch and minor | ||
# updates if all checks pass | ||
- name: Enable auto-merge for Dependabot PRs | ||
# if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }} | ||
run: gh pr merge --auto --squash "$PR_URL" | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.