[FEATURE REQUEST] Let "cookieNames" support regular expressions #247
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Issue Closer | |
on: | |
issues: | |
types: [opened, reopened] | |
jobs: | |
pre_info: | |
name: Initial Checks | |
runs-on: ubuntu-latest | |
outputs: | |
isBug: ${{ steps.issueBug.outputs.isBug }} | |
isFeature: ${{ steps.issueFeature.outputs.isFeature }} | |
isSupport: ${{ steps.issueSupport.outputs.isSupport }} | |
isDevAssoc: ${{ steps.issueDevAssoc.outputs.isDevAssoc }} | |
steps: | |
- name: Issue Parser | |
id: parseIssue | |
env: | |
GH_ISSUE: ${{ toJson(github.event.issue) }} | |
GH_ASSOC: ${{ github.event.issue.author_association }} | |
# ISSUE_BODY: ${{ github.event.issue.body }} | |
ISSUE_ID: ${{ github.event.issue.id }} | |
ISSUE_LABELS: ${{ toJson(github.event.issue.labels.*.name) }} | |
ISSUE_NUMBER: ${{ github.event.issue.number }} | |
ISSUE_TITLE: ${{ github.event.issue.title }} | |
run: | | |
echo "ASSOC: $GH_ASSOC" | |
echo "ID: $ISSUE_ID" | |
echo "NUMBER: $ISSUE_NUMBER" | |
echo "TITLE: $ISSUE_TITLE" | |
echo "LABELS: $ISSUE_LABELS" | |
- name: Issue is BUG | |
id: issueBug | |
if: startsWith(github.event.issue.title, '[BUG]') || contains(github.event.issue.labels.*.name, 'untested bug/issue') | |
run: echo "isBug=true" >> $GITHUB_OUTPUT | |
- name: Issue is Feature Request | |
id: issueFeature | |
if: startsWith(github.event.issue.title, '[FEATURE REQUEST]') || contains(github.event.issue.labels.*.name, 'Feature Request') | |
run: echo "isFeature=true" >> $GITHUB_OUTPUT | |
- name: Issue is Support | |
id: issueSupport | |
if: startsWith(github.event.issue.title, '[SUPPORT]') || contains(github.event.issue.labels.*.name, 'support') | |
run: echo "isSupport=true" >> $GITHUB_OUTPUT | |
- name: Issue created from owner or members | |
id: issueDevAssoc | |
if: github.event.issue.author_association == 'MEMBER' || github.event.issue.author_association == 'OWNER' | |
run: echo "isDevAssoc=true" >> $GITHUB_OUTPUT | |
issue_bug: | |
name: Issue Check for Bug Report | |
runs-on: ubuntu-latest | |
needs: pre_info | |
if: needs.pre_info.outputs.isDevAssoc != 'true' && needs.pre_info.outputs.isBug == 'true' | |
steps: | |
- name: Title does not start with [BUG] | |
id: missingTitlePrefix | |
if: ( ! startsWith(github.event.issue.title, '[BUG]') ) | |
run: | | |
echo "msg=- Title does not start with [BUG]." >> $GITHUB_OUTPUT | |
echo "::warning ::Title does not start with [BUG]." | |
echo "issue_close=true" >> $GITHUB_ENV | |
- name: Title not provided | |
id: missingTitle | |
if: github.event.issue.title == '' || contains(github.event.issue.title, '[BUG] ???') || endsWith(github.event.issue.title, '[BUG]') | |
run: | | |
echo "msg=- Title is missing." >> $GITHUB_OUTPUT | |
echo "::warning ::Title is missing." | |
echo "issue_close=true" >> $GITHUB_ENV | |
- name: Checking (via Bash) for System Info | |
id: sysInfoBash | |
env: | |
ISSUE_BODY: ${{ github.event.issue.body }} | |
run: | | |
EXP_OS="OS: \?+" | |
EXP_BROWSER="Browser Info: \?+" | |
EXP_CAD="CookieAutoDelete Version: \?+" | |
EXP_CADLATEST="CookieAutoDelete Version: [Ll]atest" | |
if [[ $ISSUE_BODY =~ $EXP_OS ]] || [[ $ISSUE_BODY =~ $EXP_BROWSER ]] || [[ $ISSUE_BODY =~ $EXP_CAD ]]; then | |
echo "missing=true" >> $GITHUB_OUTPUT | |
fi | |
if [[ $ISSUE_BODY =~ $EXP_CADLATEST ]]; then | |
echo "latest=true" >> $GITHUB_OUTPUT | |
fi | |
- name: System Info is not complete | |
id: missingSysInfo | |
if: steps.sysInfoBash.outputs.missing == 'true' | |
run: | | |
echo "msg=- Missing system info details." >> $GITHUB_OUTPUT | |
echo "::warning ::Missing System Info Details." | |
echo "issue_close=true" >> $GITHUB_ENV | |
- name: CAD Version set to latest | |
id: latestCAD | |
if: steps.sysInfoBash.outputs.latest == 'true' | |
run: | | |
echo "msg=- CAD Version set to **latest**. Please change this to reflect version that the bug is found in." >> $GITHUB_OUTPUT | |
echo "::warning ::CAD Version set to 'latest'." | |
echo "issue_close=true" >> $GITHUB_ENV | |
- name: Add Incomplete Label | |
if: env.issue_close == 'true' | |
uses: andymckay/labeler@1.0.4 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
add-labels: 'incomplete' | |
- name: Comment and Close Issue | |
if: env.issue_close == 'true' | |
uses: peter-evans/close-issue@v2 | |
with: | |
comment: | | |
@${{ github.actor }} This issue has been automatically closed for not following the bug report template. More specifically: | |
${{ steps.missingTitlePrefix.outputs.msg }} | |
${{ steps.missingTitle.outputs.msg }} | |
${{ steps.missingSysInfo.outputs.msg }} | |
${{ steps.latestCAD.outputs.msg }} | |
If you have modified the initial post or the required sections were already filled out, please comment and ping `@kennethtran93` to reopen it (or open a new bug report and follow the provided template). | |
issue_feature: | |
name: Issue Check for Feature Request | |
runs-on: ubuntu-latest | |
needs: pre_info | |
if: needs.pre_info.outputs.isDevAssoc != 'true' && needs.pre_info.outputs.isFeature == 'true' | |
steps: | |
- name: Title does not start with [FEATURE REQUEST] | |
id: missingTitlePrefix | |
if: ( ! startsWith(github.event.issue.title, '[FEATURE REQUEST]') ) | |
run: | | |
echo "msg=- Title does not start with [FEATURE REQUEST]." >> $GITHUB_OUTPUT | |
echo "::warning ::Title does not start with [FEATURE REQUEST]." | |
echo "issue_close=true" >> $GITHUB_ENV | |
- name: Title not provided | |
id: missingTitle | |
if: github.event.issue.title == '' || contains(github.event.issue.title, '[FEATURE REQUEST] ???') || endsWith(github.event.issue.title, '[FEATURE REQUEST]') | |
run: | | |
echo "msg=- Title is missing." >> $GITHUB_OUTPUT | |
echo "::warning ::Title is missing." | |
echo "issue_close=true" >> $GITHUB_ENV | |
- name: Add Incomplete Label | |
if: env.issue_close == 'true' | |
uses: andymckay/labeler@1.0.4 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
add-labels: 'incomplete' | |
- name: Comment and Close Issue | |
if: env.issue_close == 'true' | |
uses: peter-evans/close-issue@v2 | |
with: | |
comment: | | |
@${{ github.actor }} This issue has been automatically closed for not following the feature request template. More specifically: | |
${{ steps.missingTitlePrefix.outputs.msg }} | |
${{ steps.missingTitle.outputs.msg }} | |
If you have modified the initial post or the required sections were already filled out, please comment and ping `@kennethtran93` to reopen it (or open a new feature request issue and follow the provided template). | |
issue_support: | |
name: Issue Check for Support | |
runs-on: ubuntu-latest | |
needs: pre_info | |
if: needs.pre_info.outputs.isDevAssoc != 'true' && needs.pre_info.outputs.isSupport == 'true' | |
steps: | |
- name: Title does not start with [SUPPORT] | |
id: missingTitlePrefix | |
if: ( ! startsWith(github.event.issue.title, '[SUPPORT]') ) | |
run: | | |
echo "msg=- Title does not start with [SUPPORT]." >> $GITHUB_OUTPUT | |
echo "::warning ::Title does not start with [SUPPORT]." | |
echo "issue_close=true" >> $GITHUB_ENV | |
- name: Title not provided | |
id: missingTitle | |
if: github.event.issue.title == '' || contains(github.event.issue.title, '[SUPPORT] ???') || endsWith(github.event.issue.title, '[SUPPORT]') | |
run: | | |
echo "msg=- Title is missing." >> $GITHUB_OUTPUT | |
echo "::warning ::Title is missing." | |
echo "issue_close=true" >> $GITHUB_ENV | |
- name: Add Incomplete Label | |
if: env.issue_close == 'true' | |
uses: andymckay/labeler@1.0.4 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
add-labels: 'incomplete' | |
- name: Comment and Close Issue | |
if: env.issue_close == 'true' | |
uses: peter-evans/close-issue@v2 | |
with: | |
comment: | | |
@${{ github.actor }} This issue has been automatically closed for not following the support template. More specifically: | |
${{ steps.missingTitlePrefix.outputs.msg }} | |
${{ steps.missingTitle.outputs.msg }} | |
If you have modified the initial post or the required sections were already filled out, please comment and ping `@kennethtran93` to reopen it (or open a new support issue and follow the provided template). | |
issue_unknown: | |
name: Unknown Issue | |
runs-on: ubuntu-latest | |
needs: pre_info | |
if: needs.pre_info.outputs.isDevAssoc != 'true' && needs.pre_info.outputs.isBug != 'true' && needs.pre_info.outputs.isFeature != 'true' && needs.pre_info.outputs.isSupport != 'true' | |
steps: | |
- name: Add Incomplete Label | |
uses: andymckay/labeler@1.0.4 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
add-labels: 'incomplete' | |
- name: Comment and Close Issue | |
uses: peter-evans/close-issue@v2 | |
with: | |
comment: | | |
@${{ github.actor }} This issue has been automatically closed for not using any of the provided issue forms/templates. | |
As such, responses to this specific issue may not be given at all. | |
Please use the provided templates at https://github.com/Cookie-AutoDelete/Cookie-AutoDelete/issues/new/choose. | |
Select the relevant issue type, then read and follow the instructions given in the issue form/body. |