Giter VIP home page Giter VIP logo

octoflare's Introduction

octoflare

ci.yml

๐ŸŒค๏ธ A framework for building GitHub Apps with Cloudflare Worker

Example Apps

workflow

Start New Project with CLI

npm create octoflare

Setup

The following must be set as environment variables for Cloudflare Workers

Key Value Recommend Encryption Auto Set by CLI
OCTOFLARE_APP_ID GitHub App ID
OCTOFLARE_PRIVATE_KEY_PKCS8 GitHub App private key converted to PKCS8 format โœ”๏ธŽ
OCTOFLARE_WEBHOOK_SECRET GitHub App Webhook Secret โœ”๏ธŽ
OCTOFLARE_APP_REPO GitHub App Repository Name โœ”๏ธŽ
OCTOFLARE_APP_OWNER GitHub App Repository Owner Name โœ”๏ธŽ

Convert Privatekey

Before using the private key provided by GitHub, you need to convert it to PKCS8 format with the command below.

openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in private-key.pem -out private-key-pkcs8.key

or Using Web Tool

Commands

npm script Description
npm run lint Lint
npm run format Format by Prettier
npm run build Build worker script
npm run deploy Deploy worker script to cloudflare
npm run build:action Build GitHub javascript action

Example

Worker

// src/index.js
import { octoflare } from 'octoflare'

export default octoflare(
  async ({ request, env, app, payload, installation }) => {
    // Application Code

    // Create Status Check for Target SHA
    const { dispatchWorkflow } = await installation.createCheckRun({
      repo: 'repository-name',
      owner: 'repository-owner',
      name: 'workflow-name',
      head_sha: 'target-sha'
    })

    await dispatchWorkflow({
      // ...
    })

    return new Response('Workflow Dispatched', {
      status: 200
    })
  }
)

Handler Type Definition

Action

// action/src/index.js
import { action } from 'octoflare'

action(({ request, env, app, payload }) => {
  // Application Code

  // Return Checks Status
  return {
    conclusion: 'success',
    output: {
      title: 'Check Success',
      summary: 'The check conclude as success'
    }
  }
})

License

MIT

octoflare's People

Contributors

wraith-ci[bot] avatar renovate[bot] avatar github-actions[bot] avatar jill64 avatar

Stargazers

PizzaConsole avatar Quan Nguyen avatar  avatar ใฒใ‚‹ใ avatar Wendell Misiedjan avatar Alireza avatar Lylia avatar

Watchers

 avatar

octoflare's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • jill64/.github main
  • jill64/playwright-config v2.3.0@87d42c8a5b69f14d6af1cccf1ae38a9a778570dc
packages/create-octoflare/template/static/.github/workflows/--app-slug--.yml
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
  • actions/setup-node v4@60edb5dd545a775178f52524783378180af0d1f8
  • --GITHUB-REPO-OWNER--/--app-slug-- main
npm
package.json
  • @types/node 20.12.10
  • @jill64/eslint-config-ts 1.1.21
  • @jill64/prettier-config 1.0.0
  • @jill64/playwright-config 2.3.0
  • @playwright/test 1.44.1
  • prettier 3.2.5
  • publint 0.2.8
  • depcheck 1.4.7
  • eslint 8.57.0
  • typescript 5.4.5
  • vitest 1.6.0
packages/create-octoflare/package.json
  • @clack/prompts 0.7.0
  • deepmerge 4.3.1
  • kleur 4.1.5
packages/create-octoflare/template/dynamic/package.json
  • octoflare 0.24.37
  • esbuild 0.21.4
  • eslint 8.57.0
  • prettier 3.2.5
  • wrangler 3.57.1
packages/create-octoflare/template/dynamic/ts/package.json
  • @typescript-eslint/eslint-plugin 7.10.0
  • @typescript-eslint/parser 7.10.0
  • tsx 4.11.0
  • typescript 5.4.5
packages/octoflare/package.json
  • @actions/core 1.10.1
  • @actions/github 6.0.0
  • @cloudflare/workers-types 4.20240512.0
  • @octokit/webhooks-types 7.5.1
  • octokit 3.2.0
packages/site/package.json
  • @jill64/eslint-config-svelte 1.2.27
  • @jill64/sentry-sveltekit-cloudflare 1.7.13
  • @jill64/svelte-suite 1.2.155
  • @jill64/svelte-tailwind 1.2.32
  • @sveltejs/adapter-cloudflare 4.4.0
  • @sveltejs/kit 2.5.10
  • svelte 4.2.17
  • vite 5.2.11
  • @sveltejs/vite-plugin-svelte 3.1.0

  • Check this box to trigger a request for Renovate to run again on this repository

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.