[DEVOPS-XXX] Switching over to new cache-azure-login action #53
Workflow file for this run
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
name: Dependabot Automations | |
on: | |
pull_request_target: | |
types: [opened, synchronize, reopened] | |
workflow_call: | |
inputs: | |
autoApprove: | |
default: false | |
type: boolean | |
autoMerge: | |
default: false | |
type: boolean | |
jobs: | |
dependabot-automations: | |
name: Automatically Update Dependencies | |
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: ${{ inputs.autoApprove || inputs.autoMerge && github.actor == 'dependabot[bot]' }} | |
steps: | |
- uses: actions/checkout@v3 | |
# This second step will fail if there's no metadata and so the approval | |
# will not occur. | |
- name: Dependabot metadata | |
id: dependabot-metadata | |
uses: dependabot/fetch-metadata@v1 | |
with: | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Auto Approve Dependabot PRs | |
uses: hmarr/auto-approve-action@v3.2.1 | |
if: ${{ inputs.autoApprove && github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' }} | |
with: | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Enable auto-merge for Dependabot PRs | |
if: ${{ inputs.autoMerge && 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}} |