File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,12 +76,23 @@ jobs:
7676 GH_TOKEN : ${{ secrets.SYNC_PAT }}
7777 run : gh workflow run publish-ocv.yml --repo ${{ github.repository }} --ref ocv -f version=${{ steps.version.outputs.release }}
7878
79+ - name : Close failure issue on success
80+ if : success()
81+ env :
82+ GH_TOKEN : ${{ secrets.SYNC_PAT }}
83+ run : |
84+ existing=$(gh issue list --repo ${{ github.repository }} --state open --limit 1000 --json number,title -q '.[] | select(.title == "[actions]: sync upstream failed") | .number' | head -n 1)
85+ if [ -z "$existing" ]; then
86+ exit 0
87+ fi
88+ gh issue close "$existing" --repo ${{ github.repository }} --comment "Closed automatically after a successful sync run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
89+
7990 - name : Notify on failure
8091 if : failure()
8192 env :
8293 GH_TOKEN : ${{ secrets.SYNC_PAT }}
8394 run : |
84- existing=$(gh issue list --repo ${{ github.repository }} --search "[actions]: sync upstream failed" --state open --json number -q '.[0]. number')
95+ existing=$(gh issue list --repo ${{ github.repository }} --state open --limit 1000 --json number,title -q '.[] | select(.title == "[actions]: sync upstream failed") | . number' | head -n 1 )
8596 if [ -z "$existing" ]; then
8697 gh issue create --repo ${{ github.repository }} \
8798 --title "[actions]: sync upstream failed" \
You can’t perform that action at this time.
0 commit comments