Skip to content

Bump actions/dependency-review-action from 4.3.4 to 4.3.5 #293

Bump actions/dependency-review-action from 4.3.4 to 4.3.5

Bump actions/dependency-review-action from 4.3.4 to 4.3.5 #293

Workflow file for this run

---
# Copyright 2016-present Thomas Leplus
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: "Dependabot auto-merge"
on: pull_request
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Authenticate CLI with a PAT
env:
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
if: env.RELEASE_TOKEN != ''
run: echo "${RELEASE_TOKEN}" | gh auth login --with-token
- name: Enable auto-merge for Dependabot PRs
run: |
gh pr merge --auto --squash "${PR_URL}"
# Checking the PR title is a poor substitute for the actual PR changes
# but as long as this is used only with dependabot PRs,
# it should be safe to assume that the title is not misleading.
regexp='^Bump .* from [0-9]+\.[0-9]+\.[0-9]+ to [0-9]+\.[0-9]+\.[0-9]+( in .*)?$'
if [[ "${PR_TITLE}" =~ $regexp ]]; then
gh pr review --approve "${PR_URL}"
else
echo 'Non-semver upgrade needs manual review'
fi
env:
PR_TITLE: ${{github.event.pull_request.title}}
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}