diff --git a/.github/workflows/check-commit-message.yml b/.github/workflows/check-commit-message.yml new file mode 100644 index 0000000..34ecc02 --- /dev/null +++ b/.github/workflows/check-commit-message.yml @@ -0,0 +1,59 @@ +name: 'Commit Message Check' + +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + +jobs: + check-commit-message: + name: Check Commit Message + runs-on: ubuntu-latest + steps: + - name: Load PR commits + id: 'get-pr-commits' + uses: tim-actions/get-pr-commits@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Subject line length + uses: tim-actions/commit-message-checker-with-regex@v0.3.1 + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} + pattern: '^.{0,75}(\n.*)*$' + error: 'Subject too long (max 75)' + + - name: Subject must be an imperative statement + if: ${{ success() || failure() }} + uses: tim-actions/commit-message-checker-with-regex@v0.3.1 + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} + pattern: '^(Added|Changed|Deprecated|Removed|Fixed|Security|Bump)' + error: 'Subject must start with one of: Added, Changed, Deprecated, Removed, Fixed, Security or Bump' + + - name: Subject must reference an issue number + if: ${{ success() || failure() }} + uses: tim-actions/commit-message-checker-with-regex@v0.3.1 + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} + pattern: '^.*\[\#[\d]+\](\n.*)*$' + error: 'Subject must end with the issue number being addressed' + + - name: Subject must not end with a sentence + if: ${{ success() || failure() }} + uses: tim-actions/commit-message-checker-with-regex@v0.3.1 + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} + pattern: '^.+[^.][ ]+\[\#[\d]+\](\n.*)*$' + error: 'Subject must not end with a period' + + - name: Check Body Line Length + if: ${{ success() || failure() }} + uses: tim-actions/commit-message-checker-with-regex@v0.3.1 + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} + pattern: '^.+(\n.{0,79})*$' + error: 'Body line too long (max 79)' diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml new file mode 100644 index 0000000..a8ffc0f --- /dev/null +++ b/.github/workflows/close-stale-issues.yml @@ -0,0 +1,22 @@ +# GOAL: Close issues where the reporter was asked for information and did not provide it. +# Runs hourly, and on issue events. + +name: Close Stale Issue + +on: + schedule: + - cron: "0 0 * * *" + issue_comment: + types: [created, edited, reopened] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Close issues that have gone unanswered for more than 4 weeks + uses: dwieeb/needs-reply@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-label: needs-reply + days-before-close: 28 + close-message: "Issue closed due to inactivity. If the reported problem still occurs, please re-open this issue or file a new bug report." diff --git a/.github/workflows/remove-needs-reply-label.yml b/.github/workflows/remove-needs-reply-label.yml new file mode 100644 index 0000000..8360566 --- /dev/null +++ b/.github/workflows/remove-needs-reply-label.yml @@ -0,0 +1,26 @@ +# GOAL: Removes the needs-reply label from an issue + +name: Remove Needs Reply Label + +on: + issue_comment: + types: + - created + +jobs: + build: + runs-on: ubuntu-latest + if: | + github.event.comment.author_association != 'OWNER' && + github.event.comment.author_association != 'COLLABORATOR' + steps: + - name: Remove needs-reply label + uses: octokit/request-action@v2.x + continue-on-error: true + with: + route: DELETE /repos/:repository/issues/:issue/labels/:label + repository: ${{ github.repository }} + issue: ${{ github.issue.number }} + label: needs-reply + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index e0093ab..a5b148b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,4 @@ comixed-webui/node/* comixed-webui/node_modules/* ComiXed*Installer.exe CHANGELOG.md -comixed-metadata-comicvine-release-*.zip +comixed-metadata-comicvine-*.zip