Skip to content

varomegar/env-json-exporter

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”„ env-json-exporter

GitHub Action to clone a repository, read a properties.env file, and expose it as usable JSON across jobs.


πŸš€ What does this action do?

This custom action allows you to:

  • Clone another repository.
  • Read a properties.env file from a specific branch.
  • Convert the contents of the properties.env file into JSON.
  • Expose it as an output to be consumed using fromJSON(...) in other jobs.

Ideal for sharing configurations across repositories.


πŸ“₯ Inputs

Name Required Description
repo βœ… Repository to clone the properties.env from (e.g., org/repo).
ref βœ… Branch or tag of the repo (e.g., main, v1.0.0).
github_token βœ… Token with read access to the repository.
env_path ❌ Path to the properties.env file within the repo (default: properties.env).

πŸ“€ Outputs

Name Description
env-json The contents of the properties.env file converted to JSON

πŸ§ͺ Example usage

jobs:
  get-env:
    uses: Varomegar/env-json-exporter@v1
    with:
      repo: your-org/config-repo
      ref: main
      github_token: ${{ secrets.GH_TOKEN }}
      env_path: config/properties.env

  use-env:
    runs-on: ubuntu-latest
    needs: get-env
    steps:
      - name: Show variables
        run: |
          echo "EXAMPLE_VARS: ${{ fromJSON(needs.get-env.outputs.env-json).EXAMPLE_VARS }}"

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors