forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (37 loc) · 1.25 KB
/
delete-defunct-branch-protection-rules.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Delete Defunct Branch Protection Rules
on:
delete:
branches:
- contrib/**
jobs:
delete_protection_rules_of_deleted_branch:
runs-on: ubuntu-latest
if: github.repository == 'avidan-H/content' && github.event.ref_type == 'branch' && startsWith('contrib/', github.event.ref)
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: master
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Print Context
run: |
echo "$GITHUB_CONTEXT"
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
- name: Create Internal PR
env:
CONTENTBOT_GH_ADMIN_TOKEN: ${{ secrets.CONTENTBOT_GH_ADMIN_TOKEN }}
EVENT_PAYLOAD: ${{ toJson(github.event) }}
run: |
echo "Deleting leftover branch protection rule that applied to the contrib branch ${{ github.event.ref }}"
cd Utils/github_workflow_scripts
pipenv install --dev
pipenv run ./delete_bp_rules.py
echo "Finished Deleting Defunct Branch Protection Rules"