Skip to content

Bump dependabot/fetch-metadata from 2.0.0 to 2.2.0 #37

Bump dependabot/fetch-metadata from 2.0.0 to 2.2.0

Bump dependabot/fetch-metadata from 2.0.0 to 2.2.0 #37

Workflow file for this run

name: On pull request
on:
pull_request:
branches:
- main
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 2
matrix:
php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
os:
- ubuntu-latest
name: PHP ${{ matrix.php }}; ${{ matrix.os }}
steps:
- name: Setup PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php }}
extensions: curl, json, mbstring, pcre
ini-values: memory_limit=512M
tools: composer:v2
- name: Checkout
uses: actions/checkout@v4
- name: Composer install without dev
run: composer install --no-progress --no-dev --prefer-dist --optimize-autoloader
- name: Composer install with dev
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: PHPUnit
run: composer test
dependabot:
needs: tests
permissions:
actions: write
checks: read
contents: write
deployments: read
discussions: read
issues: write
pages: read
packages: read
pull-requests: write
repository-projects: read
security-events: write
statuses: 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 }}