Skip to content

Commit b39efd9

Browse files
authored
CI: Add bot to track deprecation prs (#51723)
1 parent 1925918 commit b39efd9

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deprecations Bot
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types:
8+
[closed]
9+
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
deprecation_update:
16+
permissions:
17+
issues: write
18+
if: >-
19+
contains(github.event.pull_request.labels.*.name, 'Deprecate') && github.event.pull_request.merged == true
20+
runs-on: ubuntu-22.04
21+
env:
22+
DEPRECATION_TRACKER_ISSUE: 50578
23+
steps:
24+
- name: Checkout
25+
run: |
26+
echo "Adding deprecation PR number to deprecation tracking issue"
27+
export PR=${{ github.event.pull_request.number }}
28+
BODY=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/issues/${DEPRECATION_TRACKER_ISSUE} |
29+
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))")
30+
echo ${BODY}
31+
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X PATCH -d "${BODY}" https://api.github.com/repos/${{ github.repository }}/issues/${DEPRECATION_TRACKER_ISSUE}

0 commit comments

Comments
 (0)