After https://github.com/seqan/seqan3/pull/2748, we may select issues via the issue number.
However, this doesn't work well on forks, and for new crons you would need to create the issue beforehand and set the number accordingly.
Hence, we can generalise the workflow to check for an existing issue and otherwise create it:
curl -H "Accept: application/vnd.github.v3+json" -X GET "https://api.github.com/repos/seqan/seqan3/is
sues?state=all&labels=Cron"
I would suggest adding a label "Cron" to all issues that are eligible. This greatly reduces the amount of returned results and prevents us from having to parse multiple "pages" of results.
Create issue with name (JasonEtco/create-an-issue@v2). Also add the "Cron" label to the issue. The action will return an issue number as result of creating an issue. Use this number for following steps.
After https://github.com/seqan/seqan3/pull/2748, we may select issues via the issue number. However, this doesn't work well on forks, and for new crons you would need to create the issue beforehand and set the number accordingly.
Hence, we can generalise the workflow to check for an existing issue and otherwise create it:
Get issue number from issue name
Instead of the issue number, we may set the issue name in the workflow. Now we can do something along the lines of (but using https://github.com/octokit/request-action instead, also see https://docs.github.com/en/rest/reference/issues#list-repository-issues):
I would suggest adding a label "Cron" to all issues that are eligible. This greatly reduces the amount of returned results and prevents us from having to parse multiple "pages" of results.
We could now parse the returned JSON (https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#fromjson) and search for the
title
and extract thenumber
if thetitle
equals the desired issue name.Workflow