GithubHelp home page GithubHelp logo

dynamic-uses's People

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

Watchers

 avatar  avatar

dynamic-uses's Issues

Pass env down?

Given

- uses: jenseng/dynamic-uses@v1
  with:
    uses: actions/setup-node@${{ steps.branch-name.outputs.current_branch }}
    with: '{ "node-version": 18 }'
  env:
    environment_variable: test

I don't believe env would be passed down into the dynamically created uses, this would be pretty integral to have as a feature

Passing multiline secret down

Hi great work i really like the idea. The current problem i facing is to pass down a secret that contains a multiline string like a SSH Private Key for example.

Do you have any idea how to escape it properly so that i can be passed in the with block.

Convert JSON to YAML array for Actions

Hello @jenseng ๐Ÿ‘‹,

Just wanted to say thank you for this work, I have a use case where my next composite action cannot process JSON. I came up with this workaround/hack and wanted to share. Given the way this works already I'm not sure you could incorporate the change without breaking existing users. I'd be happy to create a new action and attribute you if so, let me know if you have any preferences or feedback. Thank you again.

TL;DR - convert JSON to a YAML array for actions.

Screenshot 2023-05-15 at 10 29 02 AM

format_json() {
  echo $1 | jq -r '
    (
      to_entries |
      reduce .[] as $item (" ";
        . + "\n                \($item.key | ascii_upcase): '\''\($item.value)'\''"
    )
  )'
}

export WITH=$(format_json '${{ inputs.with }}')

mkdir -p ./.tmp-dynamic-uses &&

cat << 'DYNAMIC_USES_EOF' | envsubst > ./.tmp-dynamic-uses/action.yml
outputs:
  outputs:
    value: ${{ '$' }}{{ toJSON(steps.run.outputs) }}
runs:
  using: composite
  steps:
    - name: Run
      id: run
      uses: ${{ inputs.uses }}
      with: ${WITH}
DYNAMIC_USES_EOF

Passing secrets down?

With uses keyword, secrets can be passed by either providing key-values to secrets or passing down all secrets using secrets: inherit . Would it be possible with this github action? That might help prevent a lot of things needed to do for passing something like token or a client_secret or something.

License

This is an awesome action. Can you please add an official license for use/share/modifications as github defaults to the most strict licensing policy if none provided?

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.