Skip to content

chore(ci-deps): Update files based on repository configuration #2

chore(ci-deps): Update files based on repository configuration

chore(ci-deps): Update files based on repository configuration #2

# THIS CODE WAS AUTOGENERATED. DO NOT MODIFY THIS FILE DIRECTLY
# THE SOURCE CODE LIVES IN A DIFFERENT REPOSITORY:
# - centralized-templates
# FILE STEWARD: @pleo-io/team-devx,@pleo-bot-auto-approver
name: Automate PR
on:
pull_request:
# This workflow is triggered for each individual label that was added / removed
# It is necessary to detect the actual label in each job / step
types:
- labeled
- unlabeled
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}-${{ github.event.label.name }}
cancel-in-progress: true
env:
autoApproveEnabled: true
jobs:
auto-approve-pr:
runs-on: ubuntu-latest
name: Auto-approve PR
if: ${{ contains(fromJSON('["pleo-bot-renovate", "pleo-bot", "pleo-file-distributor[bot]"]'), github.actor) && github.event.label.name == 'autoapprove' }}
steps:
- uses: hmarr/auto-approve-action@v3
if: ${{ github.event.action == 'labeled' && env.autoApproveEnabled == 'true' }}
with:
github-token: ${{ secrets.PLEO_BOT_AUTO_APPROVER_TOKEN }}
review-message: "This has been auto-approved by @pleo-bot-auto-approver. If your PR isn't being auto-merged as desired, make sure to add @pleo-bot-auto-approver to the CODEOWNERS file. More details how to use Renovate [here](https://www.notion.so/pleo/How-to-use-Renovate-781e4861200744c6b38d3efd8c6d525a?pvs=4)"
automerge-pr:
# This job is used to to replace Kodiak which fails in repos that use Github's merge queue
# The main use case is to automerge PRs created by file-distirbutor
name: Detecting Label "automerge"
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'automerge' }}
steps:
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- id: enable-automerge
name: Enable Pull Request Automerge
if: ${{github.event.action == 'labeled'}}
run: gh pr merge --auto --squash "$PR_NUMBER"
env:
GITHUB_TOKEN: "${{ secrets.PLEO_BOT_AUTO_APPROVER_TOKEN }}"
PR_NUMBER: ${{ github.event.number }}
- id: disable-automerge
name: Disable Pull Request Automerge
if: ${{github.event.action == 'unlabeled'}}
run: gh pr merge --disable-auto "$PR_NUMBER"
env:
GITHUB_TOKEN: "${{ secrets.PLEO_BOT_AUTO_APPROVER_TOKEN }}"
PR_NUMBER: ${{ github.event.number }}