Skip to content

Commit

Permalink
Dep bot (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl authored Mar 1, 2023
1 parent 6bb8f73 commit 3f521ab
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 1,052 deletions.
95 changes: 0 additions & 95 deletions .circleci/config.yml

This file was deleted.

64 changes: 0 additions & 64 deletions .circleci/setup_env.sh

This file was deleted.

78 changes: 0 additions & 78 deletions .github/workflows/asv-bot.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/autoupdate-pre-commit-config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Code Checks
name: Code Checks

on:
push:
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/codeql.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/deprecations-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
steps:
- name: Checkout
run: |
echo "Adding deprecation pr number to issue"
echo ${{ github.event.pull_request.merged }} == false
ISSUENR=2
export PR=${{ github.event.pull_request.number }}
BODY=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/issues/${ISSUENR} |
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/${ISSUENR}
Loading

0 comments on commit 3f521ab

Please sign in to comment.