Initial commit
This commit is contained in:
commit
5536b379f7
|
@ -0,0 +1,9 @@
|
|||
# The ID of your GitHub App
|
||||
APP_ID=
|
||||
WEBHOOK_SECRET=development
|
||||
|
||||
# Use `trace` to get verbose logging or `info` to show less
|
||||
LOG_LEVEL=debug
|
||||
|
||||
# Go to https://smee.io/new set this to the URL that you are redirected to.
|
||||
WEBHOOK_PROXY_URL=
|
|
@ -0,0 +1,7 @@
|
|||
node_modules
|
||||
npm-debug.log
|
||||
*.pem
|
||||
.env
|
||||
package-lock.json
|
||||
coverage
|
||||
lib
|
|
@ -0,0 +1,6 @@
|
|||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "8.3"
|
||||
notifications:
|
||||
disabled: true
|
|
@ -0,0 +1,74 @@
|
|||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
education, socio-economic status, nationality, personal appearance, race,
|
||||
religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at pombeirp@users.noreply.github.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
## Contributing
|
||||
|
||||
[fork]: /fork
|
||||
[pr]: /compare
|
||||
[style]: https://standardjs.com/
|
||||
[code-of-conduct]: CODE_OF_CONDUCT.md
|
||||
|
||||
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
|
||||
|
||||
Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms.
|
||||
|
||||
## Issues and PRs
|
||||
|
||||
If you have suggestions for how this project could be improved, or want to report a bug, open an issue! We'd love all and any contributions. If you have questions, too, we'd love to hear them.
|
||||
|
||||
We'd also love PRs. If you're thinking of a large PR, we advise opening up an issue first to talk about it, though! Look at the links below if you're not sure how to open a PR.
|
||||
|
||||
## Submitting a pull request
|
||||
|
||||
1. [Fork][fork] and clone the repository.
|
||||
1. Configure and install the dependencies: `npm install`.
|
||||
1. Make sure the tests pass on your machine: `npm test`, note: these tests also apply the linter, so there's no need to lint separately.
|
||||
1. Create a new branch: `git checkout -b my-branch-name`.
|
||||
1. Make your change, add tests, and make sure the tests still pass.
|
||||
1. Push to your fork and [submit a pull request][pr].
|
||||
1. Pat your self on the back and wait for your pull request to be reviewed and merged.
|
||||
|
||||
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
|
||||
|
||||
- Follow the [style guide][style] which is using standard. Any linting errors should be shown when running `npm test`.
|
||||
- Write and update tests.
|
||||
- Keep your changes as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
|
||||
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
|
||||
|
||||
Work in Progress pull requests are also welcome to get feedback early on, or if there is something blocked you.
|
||||
|
||||
## Resources
|
||||
|
||||
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
|
||||
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
|
||||
- [GitHub Help](https://help.github.com)
|
|
@ -0,0 +1,15 @@
|
|||
ISC License
|
||||
|
||||
Copyright (c) 2019, Pedro Pombeiro <pombeirp@users.noreply.github.com> (https://status.im)
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@ -0,0 +1,23 @@
|
|||
# packages-check-bot
|
||||
|
||||
> A GitHub App built with [Probot](https://github.com/probot/probot) that checks changes to packages.json to ensure that URL schemes match intended pattern and that forks are referenced with a tag, instead of a branch.
|
||||
|
||||
## Setup
|
||||
|
||||
```sh
|
||||
# Install dependencies
|
||||
npm install
|
||||
|
||||
# Run the bot
|
||||
npm start
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
If you have suggestions for how packages-check-bot could be improved, or want to report a bug, open an issue! We'd love all and any contributions.
|
||||
|
||||
For more, check out the [Contributing Guide](CONTRIBUTING.md).
|
||||
|
||||
## License
|
||||
|
||||
[ISC](LICENSE) © 2019 Pedro Pombeiro <pombeirp@users.noreply.github.com> (https://status.im)
|
|
@ -0,0 +1,139 @@
|
|||
# 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: write
|
||||
|
||||
# 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: read
|
||||
|
||||
# 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
|
|
@ -0,0 +1,29 @@
|
|||
// Checks API example
|
||||
// See: https://developer.github.com/v3/checks/ to learn more
|
||||
module.exports = app => {
|
||||
app.on(['check_suite.requested', 'check_run.rerequested'], check)
|
||||
|
||||
async function check (context) {
|
||||
// Do stuff
|
||||
const { head_branch, head_sha } = context.payload.check_suite
|
||||
// Probot API note: context.repo() => {username: 'hiimbex', repo: 'testing-things'}
|
||||
return context.github.checks.create(context.repo({
|
||||
name: 'My app!',
|
||||
head_branch,
|
||||
head_sha,
|
||||
status: 'completed',
|
||||
conclusion: 'success',
|
||||
completed_at: new Date(),
|
||||
output: {
|
||||
title: 'Probot check!',
|
||||
summary: 'The check has passed!'
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
// For more information on building apps:
|
||||
// https://probot.github.io/docs/
|
||||
|
||||
// To get your app running against GitHub, see:
|
||||
// https://probot.github.io/docs/development/
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"name": "packages-check-bot",
|
||||
"version": "1.0.0",
|
||||
"description": "checks changes to packages.json to ensure that URL schemes match intended pattern and that forks are referenced with a tag, instead of a branch.",
|
||||
"author": "Pedro Pombeiro <pombeirp@users.noreply.github.com> (https://status.im)",
|
||||
"license": "ISC",
|
||||
"repository": "https://github.com/status-im/packages-check-bot.git",
|
||||
"homepage": "https://github.com/status-im/packages-check-bot",
|
||||
"bugs": "https://github.com/status-im/packages-check-bot/issues",
|
||||
"keywords": [
|
||||
"probot",
|
||||
"github",
|
||||
"probot-app"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "nodemon",
|
||||
"start": "probot run ./index.js",
|
||||
"lint": "standard --fix",
|
||||
"test": "jest && standard",
|
||||
"test:watch": "jest --watch --notify --notifyMode=change --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"probot": "^7.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jest": "^22.4.3",
|
||||
"nock": "^10.0.0",
|
||||
"nodemon": "^1.17.2",
|
||||
"smee-client": "^1.0.2",
|
||||
"standard": "^10.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.3.0"
|
||||
},
|
||||
"standard": {
|
||||
"env": [
|
||||
"jest"
|
||||
]
|
||||
},
|
||||
"nodemonConfig": {
|
||||
"exec": "npm start",
|
||||
"watch": [
|
||||
".env",
|
||||
"."
|
||||
]
|
||||
},
|
||||
"jest": {
|
||||
"testEnvironment": "node"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"name": "My app!",
|
||||
"head_branch": "hiimbex-patch-46",
|
||||
"head_sha": "50e5628cda538bcbb6f3fec3edebe4bb5afb3891",
|
||||
"status": "completed",
|
||||
"conclusion": "success",
|
||||
"completed_at": "2018-10-05T17:35:53.683Z",
|
||||
"output": {
|
||||
"title": "Probot check!",
|
||||
"summary": "The check has passed!"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,204 @@
|
|||
{
|
||||
"action": "requested",
|
||||
"check_suite": {
|
||||
"id": 17597619,
|
||||
"node_id": "MDEwOkNoZWNrU3VpdGUxNzU5NzYxOQ==",
|
||||
"head_branch": "hiimbex-patch-46",
|
||||
"head_sha": "50e5628cda538bcbb6f3fec3edebe4bb5afb3891",
|
||||
"status": "queued",
|
||||
"conclusion": null,
|
||||
"url": "https://api.github.com/repos/hiimbex/testing-things/check-suites/17597619",
|
||||
"before": "f5c621190066c1b2333b3e2ff01742b6696be443",
|
||||
"after": "50e5628cda538bcbb6f3fec3edebe4bb5afb3891",
|
||||
"pull_requests": [
|
||||
{
|
||||
"url": "https://api.github.com/repos/hiimbex/testing-things/pulls/121",
|
||||
"id": 220762830,
|
||||
"number": 121,
|
||||
"head": {
|
||||
"ref": "hiimbex-patch-46",
|
||||
"sha": "50e5628cda538bcbb6f3fec3edebe4bb5afb3891",
|
||||
"repo": {
|
||||
"id": 95162387,
|
||||
"url": "https://api.github.com/repos/hiimbex/testing-things",
|
||||
"name": "testing-things"
|
||||
}
|
||||
},
|
||||
"base": {
|
||||
"ref": "master",
|
||||
"sha": "43fd9749bea5ea6de51bdf01b3b1e7264cbe83bc",
|
||||
"repo": {
|
||||
"id": 95162387,
|
||||
"url": "https://api.github.com/repos/hiimbex/testing-things",
|
||||
"name": "testing-things"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"app": {
|
||||
"id": 18586,
|
||||
"node_id": "MDM6QXBwMTg1ODY=",
|
||||
"owner": {
|
||||
"login": "hiimbex",
|
||||
"id": 13410355,
|
||||
"node_id": "MDQ6VXNlcjEzNDEwMzU1",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/13410355?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/hiimbex",
|
||||
"html_url": "https://github.com/hiimbex",
|
||||
"followers_url": "https://api.github.com/users/hiimbex/followers",
|
||||
"following_url": "https://api.github.com/users/hiimbex/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/hiimbex/orgs",
|
||||
"repos_url": "https://api.github.com/users/hiimbex/repos",
|
||||
"events_url": "https://api.github.com/users/hiimbex/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/hiimbex/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
},
|
||||
"name": "checksoo",
|
||||
"description": "A Probot app",
|
||||
"external_url": "https://github.com/hiimbex/checksoo",
|
||||
"html_url": "https://github.com/apps/checksoo",
|
||||
"created_at": "2018-10-05T16:46:52Z",
|
||||
"updated_at": "2018-10-05T16:46:52Z"
|
||||
},
|
||||
"created_at": "2018-10-05T16:53:21Z",
|
||||
"updated_at": "2018-10-05T16:53:21Z",
|
||||
"latest_check_runs_count": 0,
|
||||
"check_runs_url": "https://api.github.com/repos/hiimbex/testing-things/check-suites/17597619/check-runs",
|
||||
"head_commit": {
|
||||
"id": "50e5628cda538bcbb6f3fec3edebe4bb5afb3891",
|
||||
"tree_id": "1d785b00b8f8163d656ffedddcb773a7077592f4",
|
||||
"message": "Update README.md",
|
||||
"timestamp": "2018-10-05T16:53:19Z",
|
||||
"author": {
|
||||
"name": "Bex Warner",
|
||||
"email": "bexmwarner@gmail.com"
|
||||
},
|
||||
"committer": {
|
||||
"name": "GitHub",
|
||||
"email": "noreply@github.com"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"id": 95162387,
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnk5NTE2MjM4Nw==",
|
||||
"name": "testing-things",
|
||||
"full_name": "hiimbex/testing-things",
|
||||
"private": false,
|
||||
"owner": {
|
||||
"login": "hiimbex",
|
||||
"id": 13410355,
|
||||
"node_id": "MDQ6VXNlcjEzNDEwMzU1",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/13410355?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/hiimbex",
|
||||
"html_url": "https://github.com/hiimbex",
|
||||
"followers_url": "https://api.github.com/users/hiimbex/followers",
|
||||
"following_url": "https://api.github.com/users/hiimbex/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/hiimbex/orgs",
|
||||
"repos_url": "https://api.github.com/users/hiimbex/repos",
|
||||
"events_url": "https://api.github.com/users/hiimbex/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/hiimbex/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/hiimbex/testing-things",
|
||||
"description": "this repo is radical dude ugh",
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/hiimbex/testing-things",
|
||||
"forks_url": "https://api.github.com/repos/hiimbex/testing-things/forks",
|
||||
"keys_url": "https://api.github.com/repos/hiimbex/testing-things/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/hiimbex/testing-things/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/hiimbex/testing-things/teams",
|
||||
"hooks_url": "https://api.github.com/repos/hiimbex/testing-things/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/hiimbex/testing-things/events",
|
||||
"assignees_url": "https://api.github.com/repos/hiimbex/testing-things/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/hiimbex/testing-things/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/hiimbex/testing-things/tags",
|
||||
"blobs_url": "https://api.github.com/repos/hiimbex/testing-things/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/hiimbex/testing-things/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/hiimbex/testing-things/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/hiimbex/testing-things/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/hiimbex/testing-things/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/hiimbex/testing-things/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/hiimbex/testing-things/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/hiimbex/testing-things/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/hiimbex/testing-things/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/hiimbex/testing-things/subscription",
|
||||
"commits_url": "https://api.github.com/repos/hiimbex/testing-things/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/hiimbex/testing-things/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/hiimbex/testing-things/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/hiimbex/testing-things/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/hiimbex/testing-things/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/hiimbex/testing-things/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/hiimbex/testing-things/merges",
|
||||
"archive_url": "https://api.github.com/repos/hiimbex/testing-things/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/hiimbex/testing-things/downloads",
|
||||
"issues_url": "https://api.github.com/repos/hiimbex/testing-things/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/hiimbex/testing-things/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/hiimbex/testing-things/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/hiimbex/testing-things/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/hiimbex/testing-things/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/hiimbex/testing-things/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/hiimbex/testing-things/deployments",
|
||||
"created_at": "2017-06-22T22:38:49Z",
|
||||
"updated_at": "2018-09-15T14:44:14Z",
|
||||
"pushed_at": "2018-10-05T16:53:21Z",
|
||||
"git_url": "git://github.com/hiimbex/testing-things.git",
|
||||
"ssh_url": "git@github.com:hiimbex/testing-things.git",
|
||||
"clone_url": "https://github.com/hiimbex/testing-things.git",
|
||||
"svn_url": "https://github.com/hiimbex/testing-things",
|
||||
"homepage": null,
|
||||
"size": 99,
|
||||
"stargazers_count": 0,
|
||||
"watchers_count": 0,
|
||||
"language": "JavaScript",
|
||||
"has_issues": true,
|
||||
"has_projects": true,
|
||||
"has_downloads": true,
|
||||
"has_wiki": true,
|
||||
"has_pages": false,
|
||||
"forks_count": 2,
|
||||
"mirror_url": null,
|
||||
"archived": false,
|
||||
"open_issues_count": 75,
|
||||
"license": null,
|
||||
"forks": 2,
|
||||
"open_issues": 75,
|
||||
"watchers": 0,
|
||||
"default_branch": "master"
|
||||
},
|
||||
"sender": {
|
||||
"login": "hiimbex",
|
||||
"id": 13410355,
|
||||
"node_id": "MDQ6VXNlcjEzNDEwMzU1",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/13410355?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/hiimbex",
|
||||
"html_url": "https://github.com/hiimbex",
|
||||
"followers_url": "https://api.github.com/users/hiimbex/followers",
|
||||
"following_url": "https://api.github.com/users/hiimbex/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/hiimbex/orgs",
|
||||
"repos_url": "https://api.github.com/users/hiimbex/repos",
|
||||
"events_url": "https://api.github.com/users/hiimbex/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/hiimbex/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
},
|
||||
"installation": {
|
||||
"id": 2,
|
||||
"node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMzY3NDI4"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
const nock = require('nock')
|
||||
// Requiring our app implementation
|
||||
const myProbotApp = require('..')
|
||||
const { Probot } = require('probot')
|
||||
// Requiring our fixtures
|
||||
const checkSuitePayload = require('./fixtures/check_suite.requested')
|
||||
const checkRunSuccess = require('./fixtures/check_run.created')
|
||||
|
||||
nock.disableNetConnect()
|
||||
|
||||
describe('My Probot app', () => {
|
||||
let probot
|
||||
|
||||
beforeEach(() => {
|
||||
probot = new Probot({})
|
||||
// Load our app into probot
|
||||
const app = probot.load(myProbotApp)
|
||||
|
||||
// just return a test token
|
||||
app.app = () => 'test'
|
||||
})
|
||||
|
||||
test('creates a passing check', async () => {
|
||||
nock('https://api.github.com')
|
||||
.post('/app/installations/2/access_tokens')
|
||||
.reply(200, { token: 'test' })
|
||||
|
||||
nock('https://api.github.com')
|
||||
.post('/repos/hiimbex/testing-things/check-runs', (body) => {
|
||||
body.completed_at = '2018-10-05T17:35:53.683Z'
|
||||
expect(body).toMatchObject(checkRunSuccess)
|
||||
return true
|
||||
})
|
||||
.reply(200)
|
||||
|
||||
// Receive a webhook event
|
||||
await probot.receive({ name: 'check_suite', payload: checkSuitePayload })
|
||||
})
|
||||
})
|
||||
|
||||
// For more information about testing with Jest see:
|
||||
// https://facebook.github.io/jest/
|
||||
|
||||
// For more information about testing with Nock see:
|
||||
// https://github.com/nock/nock
|
Loading…
Reference in New Issue