Skip to content

Commit

Permalink
Update monorepo-split-packages-update.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim-the-Diamond committed Sep 5, 2024
1 parent 976d22d commit 60d766a
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/monorepo-split-packages-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,26 @@ on:


jobs:
load-config:
read-json:
runs-on: ubuntu-latest
outputs:
core_version: ${{ steps.set-vars.outputs.core_version }}
packages: ${{ steps.set-vars.outputs.packages }}

steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v3

# Read and parse moox-workflow.json
- id: set-vars
- name: Install jq
run: sudo apt-get install jq

- name: Read and echo JSON variables
run: |
core_version=$(jq -r '.core_version' moox-workflow.json)
packages=$(jq -r '.packages | join(",")' moox-workflow.json)
# Define the path to your JSON file
JSON_FILE_PATH="moox-workflow.json"
echo "CORE_VERSION=${core_version}" >> $GITHUB_ENV
echo "PACKAGES=${packages}" >> $GITHUB_ENV
# Extract variables from the JSON file
VAR1=$(jq -r '.core_version' $JSON_FILE_PATH)
VAR2=$(jq -r '.packages' $JSON_FILE_PATH)
echo "::set-output name=core_version::$core_version"
echo "::set-output name=packages::$packages"
# Echo the variables
echo "Variable 1: $VAR1"
echo "Variable 2: $VAR2"

0 comments on commit 60d766a

Please sign in to comment.