Skip to content

Commit db1123b

Browse files
committed
Initial Commit
1 parent f9551e3 commit db1123b

File tree

10 files changed

+7034
-0
lines changed

10 files changed

+7034
-0
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
# create PRs for out-of-range updates
4+
- package-ecosystem: "npm"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
versioning-strategy: "increase"

.github/workflows/release.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Release
2+
"on":
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
release:
8+
name: release
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 16
15+
cache: npm
16+
- run: npx semantic-release
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.env
2+
node_modules

api/github/webhooks/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const { createNodeMiddleware, createProbot } = require("probot");
2+
3+
const app = require("../../app");
4+
5+
module.exports = createNodeMiddleware(app, {
6+
probot: createProbot(),
7+
webhooksPath: "/api/github/webhooks",
8+
});

app.js

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/**
2+
* This is the main entrypoint to your Probot app
3+
* @param {import('probot').Probot} app
4+
*/
5+
module.exports = (app) => {
6+
app.on(["issues.opened"], async (context) => {
7+
8+
const owner = context.payload.issue.user.login
9+
const repo = context.payload.repository.name
10+
const issueNumber = context.payload.issue.number
11+
const labels = context.payload.issue.labels
12+
const title = context.payload.issue.title
13+
14+
var issue = ""
15+
16+
if (labels.find(e => e.name === 'bug')) {
17+
issue = context.issue({
18+
owner: owner,
19+
repo: repo,
20+
issue_number: issueNumber,
21+
title: "🐞 " + title
22+
})
23+
} else if (labels.find(e => e.name === 'enhancement')) {
24+
issue = context.issue({
25+
owner: owner,
26+
repo: repo,
27+
issue_number: issueNumber,
28+
title: "✨ " + title
29+
})
30+
} else if (labels.find(e => e.name === 'feature request')) {
31+
issue = context.issue({
32+
owner: owner,
33+
repo: repo,
34+
issue_number: issueNumber,
35+
title: "💡 " + title
36+
})
37+
} else if (labels.find(e => e.name === 'discussion')) {
38+
issue = context.issue({
39+
owner: owner,
40+
repo: repo,
41+
issue_number: issueNumber,
42+
title: "💬 " + title
43+
})
44+
} else if (labels.find(e => e.name === 'question')) {
45+
issue = context.issue({
46+
owner: owner,
47+
repo: repo,
48+
issue_number: issueNumber,
49+
title: "❓ " + title
50+
})
51+
} else if (labels.find(e => e.name === 'priority')) {
52+
issue = context.issue({
53+
owner: owner,
54+
repo: repo,
55+
issue_number: issueNumber,
56+
title: "🚩 " + title
57+
})
58+
} else if (labels.find(e => e.name === 'feedback')) {
59+
issue = context.issue({
60+
owner: owner,
61+
repo: repo,
62+
issue_number: issueNumber,
63+
title: "📬 " + title
64+
})
65+
} else if (labels.find(e => e.name === 'urgent')) {
66+
issue = context.issue({
67+
owner: owner,
68+
repo: repo,
69+
issue_number: issueNumber,
70+
title: "🚨 " + title
71+
})
72+
}
73+
74+
return context.octokit.issues.update(issue);
75+
});
76+
};

app.yml

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# This is a GitHub App Manifest. These settings will be used by default when
2+
# initially configuring your GitHub App.
3+
#
4+
# NOTE: changing this file will not update your GitHub App settings.
5+
# You must visit github.com/settings/apps/your-app-name to edit them.
6+
#
7+
# Read more about configuring your GitHub App:
8+
# https://probot.github.io/docs/development/#configuring-a-github-app
9+
#
10+
# Read more about GitHub App Manifests:
11+
# https://developer.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/
12+
13+
# The list of events the GitHub App subscribes to.
14+
# Uncomment the event names below to enable them.
15+
default_events:
16+
# - check_run
17+
# - check_suite
18+
# - commit_comment
19+
# - create
20+
# - delete
21+
# - deployment
22+
# - deployment_status
23+
# - fork
24+
# - gollum
25+
# - issue_comment
26+
- issues
27+
# - label
28+
# - milestone
29+
# - member
30+
# - membership
31+
# - org_block
32+
# - organization
33+
# - page_build
34+
# - project
35+
# - project_card
36+
# - project_column
37+
# - public
38+
# - pull_request
39+
# - pull_request_review
40+
# - pull_request_review_comment
41+
# - push
42+
# - release
43+
# - repository
44+
# - repository_import
45+
# - status
46+
# - team
47+
# - team_add
48+
# - watch
49+
50+
# The set of permissions needed by the GitHub App. The format of the object uses
51+
# the permission name for the key (for example, issues) and the access type for
52+
# the value (for example, write).
53+
# Valid values are `read`, `write`, and `none`
54+
default_permissions:
55+
# Repository creation, deletion, settings, teams, and collaborators.
56+
# https://developer.github.com/v3/apps/permissions/#permission-on-administration
57+
# administration: read
58+
59+
# Checks on code.
60+
# https://developer.github.com/v3/apps/permissions/#permission-on-checks
61+
# checks: read
62+
63+
# Repository contents, commits, branches, downloads, releases, and merges.
64+
# https://developer.github.com/v3/apps/permissions/#permission-on-contents
65+
# contents: read
66+
67+
# Deployments and deployment statuses.
68+
# https://developer.github.com/v3/apps/permissions/#permission-on-deployments
69+
# deployments: read
70+
71+
# Issues and related comments, assignees, labels, and milestones.
72+
# https://developer.github.com/v3/apps/permissions/#permission-on-issues
73+
issues: write
74+
75+
# Search repositories, list collaborators, and access repository metadata.
76+
# https://developer.github.com/v3/apps/permissions/#metadata-permissions
77+
metadata: read
78+
79+
# Retrieve Pages statuses, configuration, and builds, as well as create new builds.
80+
# https://developer.github.com/v3/apps/permissions/#permission-on-pages
81+
# pages: read
82+
83+
# Pull requests and related comments, assignees, labels, milestones, and merges.
84+
# https://developer.github.com/v3/apps/permissions/#permission-on-pull-requests
85+
# pull_requests: read
86+
87+
# Manage the post-receive hooks for a repository.
88+
# https://developer.github.com/v3/apps/permissions/#permission-on-repository-hooks
89+
# repository_hooks: read
90+
91+
# Manage repository projects, columns, and cards.
92+
# https://developer.github.com/v3/apps/permissions/#permission-on-repository-projects
93+
# repository_projects: read
94+
95+
# Retrieve security vulnerability alerts.
96+
# https://developer.github.com/v4/object/repositoryvulnerabilityalert/
97+
# vulnerability_alerts: read
98+
99+
# Commit statuses.
100+
# https://developer.github.com/v3/apps/permissions/#permission-on-statuses
101+
# statuses: read
102+
103+
# Organization members and teams.
104+
# https://developer.github.com/v3/apps/permissions/#permission-on-members
105+
# members: read
106+
107+
# View and manage users blocked by the organization.
108+
# https://developer.github.com/v3/apps/permissions/#permission-on-organization-user-blocking
109+
# organization_user_blocking: read
110+
111+
# Manage organization projects, columns, and cards.
112+
# https://developer.github.com/v3/apps/permissions/#permission-on-organization-projects
113+
# organization_projects: read
114+
115+
# Manage team discussions and related comments.
116+
# https://developer.github.com/v3/apps/permissions/#permission-on-team-discussions
117+
# team_discussions: read
118+
119+
# Manage the post-receive hooks for an organization.
120+
# https://developer.github.com/v3/apps/permissions/#permission-on-organization-hooks
121+
# organization_hooks: read
122+
123+
# Get notified of, and update, content references.
124+
# https://developer.github.com/v3/apps/permissions/
125+
# organization_administration: read
126+
# The name of the GitHub App. Defaults to the name specified in package.json
127+
# name: My Probot App
128+
129+
# The homepage of your GitHub App.
130+
# url: https://example.com/
131+
132+
# A description of the GitHub App.
133+
# description: A description of my awesome app
134+
135+
# Set to true when your GitHub App is available to the public or false when it is only accessible to the owner of the app.
136+
# Default: true
137+
# public: false

0 commit comments

Comments
 (0)