Skip to content

Commit

Permalink
feat: adding workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalCodes committed Aug 8, 2023
1 parent d9dc3e4 commit 2e647f7
Show file tree
Hide file tree
Showing 8 changed files with 250 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "npm"
labels:
- dependencies
directory: "/"
commit-message:
prefix: "chore(deps)"
schedule:
interval: "weekly"
48 changes: 48 additions & 0 deletions .github/labeler-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
filters:
- label: "👷🏻‍♂️ status: awaiting triage"
regexs:
- /feat/i
events: [pull_request]
targets: [title]

- label: "⭐ goal: addition"
regexs:
- /feat/i
events: [pull_request]
targets: [title]


- label: "👷🏻‍♂️ status: awaiting triage"
regexs:
- /docs/i
events: [pull_request]
targets: [title]
- label: "📄 aspect: docs"
regexs:
- /docs/i
events: [pull_request]
targets: [title]


- label: "👷🏻‍♂️ status: awaiting triage"
regexs:
- /fix/i
events: [pull_request]
targets: [title]
- label: "🛠 goal: fix"
regexs:
- /fix/i
events: [pull_request]
targets: [title]


- label: "👷🏻‍♂️ status: awaiting triage"
regexs:
- /build/i
events: [pull_request]
targets: [title]
- label: "🛠 goal: fix"
regexs:
- /build/i
events: [pull_request]
targets: [title]
31 changes: 31 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name-template: "v$RESOLVED_VERSION 🌈"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: "🚀 Features"
labels:
- "⭐ goal: addition"
- "enhancement"
- title: "🐛 Bug Fixes"
labels:
- "🛠 goal: fix"
- "bugfix"
- "bug"
- title: "🧰 Maintenance"
label: "chore"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- "major"
minor:
labels:
- "minor"
patch:
labels:
- "patch"
default: patch
template: |
## Changes
$CHANGES
24 changes: 24 additions & 0 deletions .github/workflows/add-labels-to-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PR Triage Labeler

on:
pull_request_target:
types:
- opened
- reopened

jobs:
main:
runs-on: ubuntu-latest

permissions:
contents: read
issues: write
pull-requests: write

steps:
- name: Run PR Triage Labeler
uses: hoho4190/issue-pr-labeler@v1.3.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
disable-bot: false
config-file-name: labeler-config.yml
13 changes: 13 additions & 0 deletions .github/workflows/auto-author-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Auto Author Assign"

on:
pull_request_target:
types: [opened]

jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@v1.1.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
38 changes: 38 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
fork:
push:
branches: [main]
issues:
types: [opened]
pull_request_target:
types: [opened]

jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: EddieHubCommunity/gh-action-community/src/welcome@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
### Hello @${{ github.actor }}, thank you for raising the issue. </br></br>
Currently, the issue is marked as https://github.com/tamalCodes/Milan/labels/%F0%9F%91%B7%F0%9F%8F%BB%E2%80%8D%E2%99%82%EF%B8%8F%20status%3A%20awaiting%20triage which means that work for this issue is on hold and we are waiting for the maintainers/owner to review it and provide you with feedback/suggestions to proceed further.
Feel free to reach out to [Tamal](https://twitter.com/tamalCodes) on **Twitter**, or drop a mail at tamalcodes@gmail.com if you think that this issue is of critical priority. </br></br>
**Give us a ⭐ to show some support**
**Happy OpenSource 🚀**<p></p>
pr-message: |
### Hello @${{ github.actor }}, thank you for raising a pull request. </br></br>
Currently, the pull request is marked as https://github.com/tamalCodes/Milan/labels/%F0%9F%91%B7%F0%9F%8F%BB%E2%80%8D%E2%99%82%EF%B8%8F%20status%3A%20awaiting%20triage which means that work for this issue is on hold and we are waiting for the maintainers/owner to review it and provide you with feedback/suggestions to proceed further.
Feel free to reach out to [Tamal](https://twitter.com/tamalCodes) on **Twitter**, or drop a mail at tamalcodes@gmail.com if you think that this pull request is of critical priority. </br></br>
**Give us a ⭐ to show some support**
**Happy OpenSource 🚀**<p></p>
45 changes: 45 additions & 0 deletions .github/workflows/prtitle-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Lint PR title

on:
pull_request_target:
types: [opened, reopened, synchronize, edited, ready_for_review]

jobs:
lint-pr-title:
name: Lint PR title
runs-on: ubuntu-latest
steps:
- if:
${{ !contains(fromJson('[ "dependabot[bot]",
"dependabot-preview[bot]", "allcontributors"]'), github.actor) }}
uses: amannn/action-semantic-pull-request@v5 #version 4.6.0
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}" should start with a lowercase character.
- if:
${{ always() && steps.lint_pr_title.outputs.error_message != null &&
!contains(fromJson('[ "dependabot[bot]", "dependabot-preview[bot]",
"allcontributors"]'), github.actor)}}
name: Comment on PR
uses: marocchino/sticky-pull-request-comment@v2.5.0
with:
header: pr-title-lint-error
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
We require all PRs to follow [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
More details 👇🏼
```
${{ steps.lint_pr_title.outputs.error_message}}
```
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
name: delete the comment
uses: marocchino/sticky-pull-request-comment@v2.5.0
with:
header: pr-title-lint-error
delete: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
# pull_request_target event is required for autolabeler to support PRs from forks
# pull_request_target:
# types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV

# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 2e647f7

Please sign in to comment.