Giter VIP home page Giter VIP logo

actions-set-secret's Introduction

Hi i'm Hmanzur

Profile views

On my business card, I am a Sr Consultant DevOps. In my mind, I am a developer. But in my heart, I am a gamer.


Skills

Programing languages

Python Node.js Java Kotlin Android

DevOps Skills

Stats

Hmanzur's github stats

Top Langs

actions-set-secret's People

Contributors

dependabot[bot] avatar hmanzur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

actions-set-secret's Issues

Return 204 Undefined

Screenshot 2023-08-22 at 10 11 46

Ci was working without an issue, getting this error now.

Did anyone see this before?

Thanks!

Issue with secret value containing dash

Hi, your action works great for secrets with value not containing dash (-), but I noticed that whenever a secret contains dash, your action doesn't persist the secret value when creating a new secret in GitHub. For example, the following step does create the new repo secret for S3_BUCKET_NAME, however, the value is blank (see verification step below).

     - name: Create GitHub Repository secret for frontend S3_BUCKET_NAME
        uses: hmanzur/[email protected]
        with:
          name: 'S3_BUCKET_NAME'
          value: 'abc-company-bucket'
          repository: ${{ github.repository }}
          token: ${{ secrets.GH_ACTIONS_SECRETS_PAT }}

When I tried to verify that newly created secret "abc-company-bucket" using this step below, it retrieved blank value. But when I modified the secret value from "abc-company-bucket" to "abccompanybucket" in the above step, this step retrieved that value successfully.

     - name: Verify secrets
        run: |
          echo ${{ secrets.S3_BUCKET_NAME }} | sed -e 's/\(.\)/\1 /g'

Please help find root cause and provide a fix. Thanks!

Push to org

I'm willing to open a PR

I would like to use your action to push a secret to my Organization secrets. And not on my repository.

On this line you set the url to repo hard coded.

return octokit.request('PUT /repos/{repo}/actions/secrets/{name}', {

Sugestion

Declare a input to switch this hardcoded value to org. It could be a input org: true on the action.

This way it could be default false, mantaining the funcionality to the repo.

Example

  repository_or_org:
    description: Repository or organization name
    default: github.repository
    required: false

  org:
    description: flag to push to organization
    default: false
    required: false

Refs

Set value from a script

I discovered your action from this answer and wondered if I can set a secret from a script executed during the workflow.

In my case, I have a script generating a facebook token. I would like the token to update my repository secret.

Secret value leaked in Github Action logs

When using this Github Action, the secret value to be set as an input is logged in the Github Action logs that is publicly accessible to anyone logged into Github for public Github repositories.

For example in the Github Action logs it looks like:

Run hmanzur/[email protected]
  with:
    name: REPOSITORY_SECRET_TO_SET
    value: "Secret is leaked here in plaintext"
    repository: my-user/my-public-repository
    token: ***

I do not know of a workaround to redact this information from Github Action logs as it appears that only secrets specified as inputs like {{ secrets.MY_REPOSITORY_SECRET }} will be properly redacted which unfortunately defeats the purpose of this module.

My recommendation is that no one should use this Github Action module unless their Github Action logs are properly protected, redacted, or has a minimal retention window of 0 days.

See ericanastas/deploy-google-app-script-action#1 for more details

Organization secrets

Thank you for your PR #3

But there are some missing things on your PR that I managed to do on #4 (which you closed).

Organization secret

I want to upload a secret to my organization, not to my repo (which is from my organization).

Your variable _base is correct. But you are still passing a /:repo/ hardcoded on your URL.

let { data } = await this.octokit.request('GET /:base/:repo/actions/secrets/public-key', {

When uploading to organization level secret, it must be passed the owner/organization_name in the url

let { data } = await this.octokit.request('GET /:base/:owner/actions/secrets/public-key', { 

Input owner

Shouldn't be better to create a input owner for this on the action?

Input repository

Your input is using a {github.repository}.

This context returns owner/repository? I think it will return repository only.

default: ${{ github.repository }}

The urls for repo are:

  • PUT /repos/:owner/:repo/actions/secrets/:secret_name
  • GET /repos/:owner/:repo/actions/secrets/public-key

You are obfuscating the owner attribute! This caused me a lot a confusion. And a made those changes on PR #4 to declare it explicitly.

References for repository

References for organization

Is this project still maintained?

Hello @hmanzur! ๐Ÿ‘‹

I was wondering if you're still making accepting PRs and maintaining this repository. I note that there have been no commits to the main branch in 3 years. It's great if you're still active on it, and it's perfectly OK if you've moved on. โค๏ธ I would appreciate a concrete y/n answer though! ๐Ÿ˜Š

related to #21 (comment)

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.