Hold-to-approve: Rework and add fine tune timings #46
Workflow file for this run
This file contains hidden or 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: Auto Cherry-pick PRs | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [closed] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
PR_Delete_Branch: | |
runs-on: ubuntu-latest | |
name: "Delete Auto Update branch" | |
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'auto_update_') == true | |
continue-on-error: true | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Delete branch | |
run: git push origin --delete ${{ github.head_ref }} | |
PR_Check: | |
runs-on: ubuntu-latest | |
name: "Pull Request Check" | |
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'auto_update_') == false && github.event.pull_request.base.ref == 'master' | |
continue-on-error: true | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
# by default the action uses fetch-depth = 1, which creates | |
# shallow repositories from which we can't push | |
fetch-depth: 0 | |
- name : Python dependencies | |
run: pip install PyGithub GitPython | |
- name : PR check | |
run: .github/workflows/scripts/pr_check.py -t ${{ secrets.GITHUB_TOKEN }} -r ${{ github.event.repository.name }} -p ${{ github.event.number }} |