Skip to content

Commit

Permalink
Merge pull request #1 from nanashili/main
Browse files Browse the repository at this point in the history
CodeEditApp Bot
  • Loading branch information
austincondiff authored Apr 24, 2022
2 parents f9551e3 + e0f4bb4 commit 0f2c21d
Show file tree
Hide file tree
Showing 10 changed files with 7,034 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
# create PRs for out-of-range updates
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
versioning-strategy: "increase"
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release
"on":
push:
branches:
- main
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
cache: npm
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
node_modules
8 changes: 8 additions & 0 deletions api/github/webhooks/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { createNodeMiddleware, createProbot } = require("probot");

const app = require('../../../app');

module.exports = createNodeMiddleware(app, {
probot: createProbot(),
webhooksPath: "/api/github/webhooks",
});
76 changes: 76 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/**
* This is the main entrypoint to your Probot app
* @param {import('probot').Probot} app
*/
module.exports = (app) => {
app.on(["issues.opened"], async (context) => {

const owner = context.payload.issue.user.login
const repo = context.payload.repository.name
const issueNumber = context.payload.issue.number
const labels = context.payload.issue.labels
const title = context.payload.issue.title

var issue = ""

if (labels.find(e => e.name === 'bug')) {
issue = context.issue({
owner: owner,
repo: repo,
issue_number: issueNumber,
title: "🐞 " + title
})
} else if (labels.find(e => e.name === 'enhancement')) {
issue = context.issue({
owner: owner,
repo: repo,
issue_number: issueNumber,
title: "✨ " + title
})
} else if (labels.find(e => e.name === 'feature request')) {
issue = context.issue({
owner: owner,
repo: repo,
issue_number: issueNumber,
title: "💡 " + title
})
} else if (labels.find(e => e.name === 'discussion')) {
issue = context.issue({
owner: owner,
repo: repo,
issue_number: issueNumber,
title: "💬 " + title
})
} else if (labels.find(e => e.name === 'question')) {
issue = context.issue({
owner: owner,
repo: repo,
issue_number: issueNumber,
title: "❓ " + title
})
} else if (labels.find(e => e.name === 'priority')) {
issue = context.issue({
owner: owner,
repo: repo,
issue_number: issueNumber,
title: "🚩 " + title
})
} else if (labels.find(e => e.name === 'feedback')) {
issue = context.issue({
owner: owner,
repo: repo,
issue_number: issueNumber,
title: "📬 " + title
})
} else if (labels.find(e => e.name === 'urgent')) {
issue = context.issue({
owner: owner,
repo: repo,
issue_number: issueNumber,
title: "🚨 " + title
})
}

return context.octokit.issues.update(issue);
});
};
137 changes: 137 additions & 0 deletions app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# This is a GitHub App Manifest. These settings will be used by default when
# initially configuring your GitHub App.
#
# NOTE: changing this file will not update your GitHub App settings.
# You must visit github.com/settings/apps/your-app-name to edit them.
#
# Read more about configuring your GitHub App:
# https://probot.github.io/docs/development/#configuring-a-github-app
#
# Read more about GitHub App Manifests:
# https://developer.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/

# The list of events the GitHub App subscribes to.
# Uncomment the event names below to enable them.
default_events:
# - check_run
# - check_suite
# - commit_comment
# - create
# - delete
# - deployment
# - deployment_status
# - fork
# - gollum
# - issue_comment
- issues
# - label
# - milestone
# - member
# - membership
# - org_block
# - organization
# - page_build
# - project
# - project_card
# - project_column
# - public
# - pull_request
# - pull_request_review
# - pull_request_review_comment
# - push
# - release
# - repository
# - repository_import
# - status
# - team
# - team_add
# - watch

# The set of permissions needed by the GitHub App. The format of the object uses
# the permission name for the key (for example, issues) and the access type for
# the value (for example, write).
# Valid values are `read`, `write`, and `none`
default_permissions:
# Repository creation, deletion, settings, teams, and collaborators.
# https://developer.github.com/v3/apps/permissions/#permission-on-administration
# administration: read

# Checks on code.
# https://developer.github.com/v3/apps/permissions/#permission-on-checks
# checks: read

# Repository contents, commits, branches, downloads, releases, and merges.
# https://developer.github.com/v3/apps/permissions/#permission-on-contents
# contents: read

# Deployments and deployment statuses.
# https://developer.github.com/v3/apps/permissions/#permission-on-deployments
# deployments: read

# Issues and related comments, assignees, labels, and milestones.
# https://developer.github.com/v3/apps/permissions/#permission-on-issues
issues: write

# Search repositories, list collaborators, and access repository metadata.
# https://developer.github.com/v3/apps/permissions/#metadata-permissions
metadata: read

# Retrieve Pages statuses, configuration, and builds, as well as create new builds.
# https://developer.github.com/v3/apps/permissions/#permission-on-pages
# pages: read

# Pull requests and related comments, assignees, labels, milestones, and merges.
# https://developer.github.com/v3/apps/permissions/#permission-on-pull-requests
# pull_requests: read

# Manage the post-receive hooks for a repository.
# https://developer.github.com/v3/apps/permissions/#permission-on-repository-hooks
# repository_hooks: read

# Manage repository projects, columns, and cards.
# https://developer.github.com/v3/apps/permissions/#permission-on-repository-projects
# repository_projects: read

# Retrieve security vulnerability alerts.
# https://developer.github.com/v4/object/repositoryvulnerabilityalert/
# vulnerability_alerts: read

# Commit statuses.
# https://developer.github.com/v3/apps/permissions/#permission-on-statuses
# statuses: read

# Organization members and teams.
# https://developer.github.com/v3/apps/permissions/#permission-on-members
# members: read

# View and manage users blocked by the organization.
# https://developer.github.com/v3/apps/permissions/#permission-on-organization-user-blocking
# organization_user_blocking: read

# Manage organization projects, columns, and cards.
# https://developer.github.com/v3/apps/permissions/#permission-on-organization-projects
# organization_projects: read

# Manage team discussions and related comments.
# https://developer.github.com/v3/apps/permissions/#permission-on-team-discussions
# team_discussions: read

# Manage the post-receive hooks for an organization.
# https://developer.github.com/v3/apps/permissions/#permission-on-organization-hooks
# organization_hooks: read

# Get notified of, and update, content references.
# https://developer.github.com/v3/apps/permissions/
# organization_administration: read
# The name of the GitHub App. Defaults to the name specified in package.json
# name: My Probot App

# The homepage of your GitHub App.
# url: https://example.com/

# A description of the GitHub App.
# description: A description of my awesome app

# 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.
# Default: true
# public: false
Loading

1 comment on commit 0f2c21d

@vercel
Copy link

@vercel vercel bot commented on 0f2c21d Apr 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

github-bot – ./

github-bot-git-main-codeedit.vercel.app
github-bot-bice.vercel.app
github-bot-codeedit.vercel.app

Please sign in to comment.