mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-17 01:48:16 +01:00
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
# yamllint disable rule:line-length
|
|
# shellcheck disable=SC2043
|
|
---
|
|
name: PR automerge
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- labeled
|
|
- synchronize
|
|
- opened
|
|
- edited
|
|
- ready_for_review
|
|
- reopened
|
|
- unlocked
|
|
pull_request_review:
|
|
types:
|
|
- submitted
|
|
|
|
jobs:
|
|
auto-merge:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check PR title
|
|
run: |
|
|
title="${{ github.event.pull_request.title }}"
|
|
if [[ "$title" == *"auto_merge"* ]]; then
|
|
echo "PR title contains auto_merge"
|
|
echo "AUTO_MERGE=true" >> $GITHUB_ENV
|
|
else
|
|
echo "PR title does not contain automerge"
|
|
echo "AUTO_MERGE=false" >> $GITHUB_ENV
|
|
fi
|
|
- name: Check PR status
|
|
if: env.AUTO_MERGE == 'true'
|
|
run: |
|
|
status="${{ github.event.check_suite.conclusion }}"
|
|
if [[ "$status" == "success" ]]; then
|
|
echo "All checks are successful"
|
|
echo "PR_STATUS=true" >> $GITHUB_ENV
|
|
else
|
|
echo "Some checks are not successful"
|
|
echo "PR_STATUS=false" >> $GITHUB_ENV
|
|
fi
|
|
- name: Merge PR
|
|
if: env.PR_STATUS == 'true'
|
|
uses: "pascalgn/automerge-action@v0.16.2"
|
|
env:
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|