forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 2
31 lines (27 loc) · 1.08 KB
/
deprecation-tracking-bot.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
name: Deprecations Bot
on:
pull_request:
branches:
- main
types:
[closed]
permissions:
contents: read
jobs:
deprecation_update:
permissions:
issues: write
if: >-
contains(github.event.pull_request.labels.*.name, 'Deprecate') && github.event.pull_request.merged == true
runs-on: ubuntu-22.04
env:
DEPRECATION_TRACKER_ISSUE: 50578
steps:
- name: Checkout
run: |
echo "Adding deprecation PR number to deprecation tracking issue"
export PR=${{ github.event.pull_request.number }}
BODY=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/issues/${DEPRECATION_TRACKER_ISSUE} |
python3 -c "import sys, json, os; x = {'body': json.load(sys.stdin)['body']}; pr = os.environ['PR']; x['body'] += f'\n- [ ] #{pr}'; print(json.dumps(x))")
echo ${BODY}
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X PATCH -d "${BODY}" https://api.github.com/repos/${{ github.repository }}/issues/${DEPRECATION_TRACKER_ISSUE}