[DEVOPS-269] Lint PR for Jira issue key before Jira linter #89
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" | |
description: Array of version update to automatically approve (for ex. '["version-update:semver-major", "version-update:semver-minor"]') | |
type: string | |
autoMerge: | |
default: "false" | |
description: Array of version update to automatically merge in (for ex. '["version-update:semver-major", "version-update:semver-minor"]') | |
type: string | |
jobs: | |
dependabot-automations: | |
name: Dependabot Automations | |
runs-on: ubuntu-latest | |
if: ${{ github.actor == 'dependabot[bot]' && inputs.autoApprove != 'false' || inputs.autoMerge != 'false' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# The approval step will fail if there's no metadata. | |
- name: Retrieve dependabot metadata | |
id: dependabot-metadata | |
uses: dependabot/fetch-metadata@v1 | |
with: | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Approve PR | |
if: ${{ contains(fromJson(inputs.autoApprove), steps.dependabot-metadata.outputs.update-type) }} | |
uses: hmarr/auto-approve-action@v3 | |
with: | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Enable auto-merge | |
if: ${{ contains(fromJson(inputs.autoMerge), steps.dependabot-metadata.outputs.update-type) }} | |
env: | |
PR_URL: ${{ github.event.pull_request.html_url }} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
run: | | |
gh pr merge --auto --squash "${PR_URL}" |