Code Monkey home page Code Monkey logo

cgmanifest-schema's Introduction

This repository contains an Octokit script that will automatically add JSON Schema to cgmanifest.json files.

Setup

NOTE: This script requires Node.js 18+.

  1. Create a GitHub Personal Access Token with the repo scope
  2. Rename the .env.sample file to .env
  3. Put your GitHub Personal Access Token in the GITHUB_TOKEN environment variable

FAQ

Why?

We receive a lot of support request about cgmanifest.json files. By providing a JSON Schema, it allows users to make sure that their cgmanifest.json file is valid, without asking us. It also enables intellisense in Visual Studio Code and Visual Studio.

What's the logic behind this?

  1. Search for any repositories that contain a cgmanifest.json file
  2. For each repository:
    1. Check if the repository is archived or private
      • If yes, skip to next repository
    2. Check if the repository has already been forked to the Octokit user
      • If yes, fetch the fork
      • If no, create a fork
    3. Check if there is already a pull request for updating cgmanifest.json
      • If yes, skip to next repository
    4. Fetch the cgmanifest.json file from the current repository
    5. Add the $schema property to the cgmanifest.json file
    6. Format the cgmanifest.json file using prettier
    7. Check if the cgmanifest-schema branch exists in the fork
      • If yes, delete the existing cgmanifest-schema branch
    8. Create the cgmanifest-schema branch in the fork
    9. Update the cgmanifest-schema branch in the fork with the formatted cgmanifest.json file
    10. Create a pull request for the cgmanifest-schema branch from the fork

How do I create pull requests against the original repository?

Currently, the script opens pull requests against the fork. To create pull requests against the original repository you need to change this line from:

fork.data.owner.login

to:

result.repository.owner.login

How do I track the progress?

There's another script called track-progress.ts that allows you to track the status of pull requests created by this script. You can run it by running npm run track-progress.

The track progress script isn't showing me any results

Check that the user: parameter in the search query used in track-progress.ts is the same as the organization you're opening pull requests for.

cgmanifest-schema's People

Watchers

 avatar  avatar  avatar

cgmanifest-schema's Issues

Dependency Dashboard

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

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): lock file maintenance

Detected dependencies

npm
package.json
  • dotenv 16.0.2
  • node-fetch 3.2.10
  • octokit 2.0.7
  • prettier 2.7.1
  • prettier-plugin-sort-json 0.0.3
  • signale 1.4.0
  • @octokit/graphql-schema 12.6.0
  • @tsconfig/node18-strictest-esm 1.0.1
  • @types/eslint 8.4.6
  • @types/node 16.11.59
  • @types/prettier 2.7.0
  • @types/signale 1.4.4
  • @typescript-eslint/eslint-plugin 5.38.0
  • @typescript-eslint/parser 5.38.0
  • eslint 8.23.1
  • eslint-plugin-import 2.26.0
  • ts-node 10.9.1
  • typescript 4.8.3
  • node >=18.0.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.