Giter Site home page Giter Site logo

dotnet-talk-appsetting-to-github-secrets's Introduction

Tool to Move All Variables from .Net AppSetting.json to the GitHub Secrets

Simple NodeJs to push all appsetting values (as json) to Github Environment Secrets

Setting up a secure pipeline to perform release operations from Github repositories, requires putting sensitive data stored in AppSetting into Git secrets. This is usually done in the final stages of the project and when the AppSettings structure that includes tens of different data is finished. Transferring all these data to the GitHub secrets may be long and very boring. This becomes much more difficult when you have several different environments such as dev and staging.

This is a simple tool that works on top of the GitHub API(s) to upload all variables and properties from the existing AppSettings to the GitHub secrets. The tool is written in Node Js.

For using the tool, please follow these steps

Find the repository id

Finding a repository ID on GitHub can take hours as there is no user interface for this. I found an easy way to do this via the metadata element on the main page of the repository on GitHub:

  1. View the page source (Right Click > View Page Source in Chrome or Firefox for example)
  2. Search the page source and look for octolytics-dimension-repository_id. You should find something that looks like: (In this example, the ID of the repository is 123456789.)

Create "Personal Access Token" in Your GitHub repository

  1. To do follow this link (https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token)

How to use

  1. Replace the [Auth Key] with your repository auth key that you generated. image

  2. Replace the [Repo Id] with your Repo Id (Step 1) and replace the [End Name] with the environment name (GitHub Repository Id) image

  3. yarn

  4. yarn github-secrets --source ./appsettings.json

dotnet-talk-appsetting-to-github-secrets's People

Contributors

mehdimohseni82 avatar mohsenimehdi avatar

Stargazers

Omid Naghizadeh avatar

Watchers

 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.