Giter VIP home page Giter VIP logo

github-actions-secrets-creator's Introduction

GitHub Actions Secrets Creator

This is good project I have used to learn more about: Github Actions, tokens, secrets, GitOps, Github Marketplace.

release

This action can create or update secrets in the GitHub Actions API. It supports both repository and organization secrets in a unified input syntax.

Usage

Basic example (creates a secret in the repository where the workflow file is located):

steps:
  - uses: jon-grey/github-actions-secrets-creator@v1
    with:
      name: FRONT_DOOR_PASSWORD
      value: Eternia
      pa_token: ${{ secrets.PA_TOKEN }}

Create a secret in a different repository:

steps:
  - uses: jon-grey/github-actions-secrets-creator@v1
    with:
      location: horde-prime/spire-network
      name: BROADCAST_FREQUENCY
      value: ${{ secrets.JAMMING_FREQUENCY }}
      pa_token: ${{ secrets.PAT_WRONG_HORDAK }}

Create a secret in an organization:

steps:
  - uses: jon-grey/github-actions-secrets-creator@v1
    with:
      location: united-states-air-force
      name: NUCLEAR_LAUNCH_CODES
      value: '00000000'
      org_visibility: all
      pa_token: ${{ secrets.PAT_STRATEGIC_AIR_COMMAND }}

Inputs

name

Required Name of the secret that you want to create/update.

value

Required Value of the secret that you want to create/update.

This action cannot mask the provided secret value in workflow logs. If you do not want the value to appear the outputs of your workflow runs, it has to be masked before it is provided to this action as input.

location

Name of a GitHub repository or organization where you want to create/update a secret. Expects the notation owner/repo for repositories. Defaults to the repository that invoked the workflow.

pa_token

Required Personal access token with permission to modify repository or organization secrets.

For more information on PATs see the GitHub docs article on creating a personal access token. The GitHub Secrets API requires the repo scope to modify secrets in private repositories and the public_repo scope for public repositories. It requires admin:org scope to modify secrets in an organization. Save token ie PA_TOKEN and its value as secret PA_TOKEN value in repo.

org_visibility

Only used for organization secrets. Can be set to one of 3 values:

  • all will make the secret visible to all repositories in the organization
  • private makes it visible only to repositories that are not public
  • any other input value will be interpreted as a list of comma-seperated GitHub repository IDs, which will cause the created secret to be selectively visible only from these repositories

Defaults to private.

GitHub repository IDs are not repository URLs or names. They are a number used to identify repositories on GitHub specifically. For more information see the GitHub API documentation on repositories or this question on Stack Overflow.

Outputs

status

HTTP Status Code of the request against the GitHub API that created/updated the secret.

License

This project is licensed under the terms of the MIT License

github-actions-secrets-creator's People

Contributors

rgr-ralf-it avatar jpoehnelt 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.