Add stale exempt labels to the repository

This commit is contained in:
Eric Nemchik 2023-07-14 21:20:28 -05:00 committed by GitHub
parent 59fc4c47cd
commit 21060ab3a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,31 @@ concurrency:
group: lock
jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Add stale exempt labels to the repository
run: |
# awaiting-approval
if curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/labels/awaiting-approval | grep -q 'awaiting-approval'; then
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST https://api.github.com/repos/${{ github.repository }}/labels/awaiting-approval \
-d '{"description":"Stale exempt"}'
else
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST https://api.github.com/repos/${{ github.repository }}/labels \
-d '{"name":"awaiting-approval","description":"Stale exempt"}'
fi
# work-in-progress
if curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/labels/work-in-progress | grep -q 'work-in-progress'; then
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST https://api.github.com/repos/${{ github.repository }}/labels/work-in-progress \
-d '{"description":"Stale exempt"}'
else
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST https://api.github.com/repos/${{ github.repository }}/labels \
-d '{"name":"work-in-progress","description":"Stale exempt"}'
fi
stale:
runs-on: ubuntu-latest