Coder Social home page Coder Social logo

renovate-bot / sammyfilly-_-jira-github-pr-check Goto Github PK

View Code? Open in Web Editor NEW

This project forked from x-oss-byte/jira-github-pr-check

1.0 0.0 0.0 360 KB

Checks GitHub pull requests for valid and accepted Jira tickets. Used for ICU and CLDR

License: Other

JavaScript 76.20% EJS 23.80%

sammyfilly-_-jira-github-pr-check's Introduction

Jira GitHub PR Checker

A small webhook service that forces GitHub pull requests to have a valid, accepted Jira ticket in the title.

This service can be run on its own, and it is also designed with the capability to run as a GCP Cloud Function.

Quick Start

To run as a server locally on the port given in the environment variable:

$ node bin/server.js

If running as a GCP Cloud Function, set "app" as the "Function to execute" in the Cloud Functions settings page. The server.js file will not be used; GCP will import the library function from app.js directly.

The file "cloudbuild.yaml" is available in case you want to set up an automatic deployment based on a git repository push trigger.

PR Flags

The following "variables" can be set in the pull request body to change the behavior of the checker.

// Allow commits with mixed issue tags
DISABLE_JIRA_ISSUE_MATCH=true

// Allow multiple commits in the same PR
ALLOW_MANY_COMMITS=true

Environment

The following environment variables are expected. If a .env file is present, they will be read from there:

# Hostname of your Jira instance.
JIRA_URL=unicode-org.atlassian.net

# Authentication for your Jira instance.
# If not present, authentication for Jira will not be used.
#
# JIRA_USERNAME should be an *email address*, and JIRA_PASSWORD should be an
# API token generated at https://id.atlassian.com/manage/api-tokens
[email protected]
JIRA_PASSWORD=bar

# URL prefix used for hyperlinks.
URL_PREFIX=http://localhost:3000

# Optional URL to your contribution guidelines; produces a link on the info page:
INSTRUCTIONS_URL=http://site.icu-project.org/processes/contribute

# Port to use when serving.
# Not required when used in Google Cloud Functions.
PORT=3000

# Optional GitHub secret; save the secret here and in the "secret" field when configuring the GitHub webhook:
GITHUB_WEBHOOK_SECRET=xxxxxxxxxx

# Committer name and email, used for squash commits.
# By default, use author as committer.
COMMITTER_NAME=Squash Bot
[email protected]

# Secret for the cookie session, used to store the user's GitHub access token in a cookie.
COOKIE_SECRET=xxxxxxxxxx

# Optional list of repos to disable status updates (only enable force-push checking)
DO_NOT_TOUCH_REPOS=org/repo1,org/repo2

# GitHub permissions:

# Option 1: Personal Access Token; easiest and useful for testing.
# Create one of these from https://github.com/settings/tokens
GITHUB_TOKEN=xxxxxxxxxx

# Option 2: GitHub App
# Create one of these from https://github.com/settings/apps
# If using an organization account, you can create the GitHub app there.
#
# GitHub App Permissions and Webhooks:
#  - Pull requests: Access: Read-only
#  - Commit statuses: Access: Read & write
#  - Subscribe to events: Pull request
#
# Find the ID (an integer) under "About" after you create the GitHub app.
# Find the Installation ID (another integer) in the URL after you add the app with permissions to your repositories.
GITHUB_APP_ID=12345
GITHUB_APP_INSTALLATION_ID=123456

# GitHub Apps use private keys for authentication to GitHub APIs.
# Choose 2a or 2b for how to specify your private key file, generated near the bottom of the GitHub app main information screen.

# 2a: PEM file path, relative to the repository root.
# The directory "keys" can be created; it is ignored by source control.
GITHUB_APP_PEM_FILE=keys/xyz.private-key.pem

# 2b: PEM as an environment variable blob.
# Encode the PEM file as base64 and save it in this environment variable.
GITHUB_APP_PEM_BLOB=LS0tLS1...

# In addition, you should make an OAuth App that can get user-by-user permissions to perform squash commits.
# Create one of these from https://github.com/settings/developers
# If using an organization account, you can create the OAuth app there.
GITHUB_OAUTH_CLIENT_ID=xxxxxxxxxx
GITHUB_OAUTH_CLIENT_SECRET=xxxxxxxxxx

Copyright & Licenses

Copyright © 2018-2023 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the United States and other countries.

The project is released under LICENSE.

A CLA is required to contribute to this project - please refer to the CONTRIBUTING.md file (or start a Pull Request) for more information.

sammyfilly-_-jira-github-pr-check's People

Contributors

dependabot[bot] avatar sffc avatar srl295 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.