Skip to content

Commit

Permalink
Added additional workflow actions [#4]
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpierce committed Mar 23, 2024
1 parent bd9f9f0 commit 3181e07
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 1 deletion.
59 changes: 59 additions & 0 deletions .github/workflows/check-commit-message.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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/[email protected]
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/[email protected]
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/[email protected]
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/[email protected]
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
pattern: '^.+(\n.{0,79})*$'
error: 'Body line too long (max 79)'
22 changes: 22 additions & 0 deletions .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
@@ -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."
26 changes: 26 additions & 0 deletions .github/workflows/remove-needs-reply-label.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3181e07

Please sign in to comment.