Skip to content

Update test.yml

Update test.yml #13

Workflow file for this run

name: Close Fixed Issues
on:
push:
branches:
- main
jobs:
closeIssues:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Close Fixed Issues
run: |
issues=$(curl -s -H "Authorization: ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/TerraFirmaGreg-Team/Modpack-1.20.x/issues?state=open")
for issue in $(echo "${issues}" | jq -r '.[].number'); do
labels=$(curl -s -H "Authorization: ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/TerraFirmaGreg-Team/Modpack-1.20.x/issues/${issue}/labels")
if echo "${labels}" | jq -e '.[].name | select(. == "2. Status: Fixed in Dev")' > /dev/null; then
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/TerraFirmaGreg-Team/Modpack-1.20.x/issues/${issue}" \
-d '{"state": "closed"}'
fi
done