Skip to content

Commit

Permalink
ci: add necessary GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rainx committed Sep 16, 2023
1 parent 667fe2c commit 327c3c9
Show file tree
Hide file tree
Showing 6 changed files with 215 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
- name: "breaking-change"
color: ee0701
description: "A change that changes the API or breaks backward compatibility for users."
- name: "bugfix"
color: ee0701
description: "Inconsistencies or issues which will cause a problem for users or implementors."
- name: "documentation"
color: 0052cc
description: "Solely about the documentation of the project."
- name: "enhancement"
color: 1d76db
description: "Enhancement of the code, not introducing new features."
- name: "refactor"
color: 1d76db
description: "Updating the code with simpler, easier to understand or more efficient syntax or methods, but not introducing new features."
- name: "performance"
color: 1d76db
description: "Improving performance of the project, not introducing new features."
- name: "new-feature"
color: 0e8a16
description: "New features or options."
- name: "maintenance"
color: 2af79e
description: "Generic maintenance tasks."
- name: "ci"
color: 1d76db
description: "Work that improves the continuous integration."
- name: "dependencies"
color: 1d76db
description: "Change in project dependencies."

- name: "in-progress"
color: fbca04
description: "Issue is currently being worked on by a developer."
- name: "stale"
color: fef2c0
description: "No activity for quite some time."
- name: "no-stale"
color: fef2c0
description: "This is exempt from the stale bot."

- name: "security"
color: ee0701
description: "Addressing a vulnerability or security risk in this project."
- name: "incomplete"
color: fef2c0
description: "Missing information."
- name: "invalid"
color: fef2c0
description: "This is off-topic, spam, or otherwise doesn't apply to this project."

- name: "beginner-friendly"
color: 0e8a16
description: "Good first issue for people wanting to contribute to this project."
- name: "help-wanted"
color: 0e8a16
description: "We need some extra helping hands or expertise in order to resolve this!"

- name: "priority-critical"
color: ee0701
description: "Must be addressed as soon as possible."
- name: "priority-high"
color: b60205
description: "After critical issues are fixed, these should be dealt with before any further issues."
- name: "priority-medium"
color: 0e8a16
description: "This issue may be useful, and needs some attention."
- name: "priority-low"
color: e4ea8a
description: "Nice addition, maybe... someday..."

- name: "major"
color: b60205
description: "This PR causes a major bump in the version number."
- name: "minor"
color: 0e8a16
description: "This PR causes a minor bump in the version number."
20 changes: 20 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: CodeQL

on:
push:
pull_request:
schedule:
- cron: "30 1 * * 0"

jobs:
codeql:
name: 🏭 Scanning
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2
- name: 🏗 Initialize CodeQL
uses: github/codeql-action/init@v1
- name: 🚀 Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
21 changes: 21 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Sync labels

on:
push:
branches:
- main
paths:
- .github/labels.yml

jobs:
labels:
name: ♻️ Sync labels
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2
- name: 🚀 Run Label Syncer
uses: micnncim/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Lock

on:
schedule:
- cron: "0 9 * * *"
workflow_dispatch:

jobs:
lock:
name: 🔒 Lock closed issues and PRs
runs-on: ubuntu-latest
steps:
- uses: dessant/[email protected]
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: "30"
issue-lock-reason: ""
issue-comment: >
Issue closed and locked due to lack of activity.
If you encounter this same issue, please open a new issue and refer
to this closed one.
pr-lock-inactive-days: "1"
pr-lock-reason: ""
pr-comment: >
Pull Request closed and locked due to lack of activity.
If you'd like to build on this closed PR, you can clone it using
this method: https://stackoverflow.com/a/14969986
Then open a new PR, referencing this closed PR in your message.
20 changes: 20 additions & 0 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: PR Labels

on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]

jobs:
pr_labels:
name: 🏭 Verify
runs-on: ubuntu-latest
steps:
- name: 🏷 Verify PR has a valid label
uses: jesusvasquez333/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
valid-labels: >-
breaking-change, bugfix, documentation, enhancement,
refactor, performance, new-feature, maintenance, ci, dependencies
disable-reviews: true
44 changes: 44 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Stale

on:
schedule:
- cron: "0 8 * * *"
workflow_dispatch:

jobs:
stale:
name: 🧹 Clean up stale issues and PRs
runs-on: ubuntu-latest
steps:
- name: 🚀 Run stale
uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
days-before-close: 7
remove-stale-when-updated: true
stale-issue-label: "stale"
exempt-issue-labels: "no-stale,help-wanted"
stale-issue-message: >
There hasn't been any activity on this issue recently, and in order
to prioritize active issues, it will be marked as stale.
Please make sure to update to the latest version and
check if that solves the issue. Let us know if that works for you
by leaving a 👍
Because this issue is marked as stale, it will be closed and locked
in 7 days if no further activity occurs.
Thank you for your contributions!
stale-pr-label: "stale"
exempt-pr-labels: "no-stale"
stale-pr-message: >
There hasn't been any activity on this pull request recently, and in
order to prioritize active work, it has been marked as stale.
This PR will be closed and locked in 7 days if no further activity
occurs.
Thank you for your contributions!

0 comments on commit 327c3c9

Please sign in to comment.