Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/surnet/get-json-matrix
Gets a GitHub Action Matrix array for every item in a JSON
https://github.com/surnet/get-json-matrix
actions github github-actions json matrix
Last synced: 2 days ago
JSON representation
Gets a GitHub Action Matrix array for every item in a JSON
- Host: GitHub
- URL: https://github.com/surnet/get-json-matrix
- Owner: Surnet
- License: mit
- Created: 2023-06-13T12:09:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-01T15:59:56.000Z (14 days ago)
- Last Synced: 2024-11-01T16:22:57.768Z (14 days ago)
- Topics: actions, github, github-actions, json, matrix
- Language: TypeScript
- Homepage:
- Size: 1.21 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
[![Build Status](https://github.com/Surnet/get-json-matrix/actions/workflows/test.yml/badge.svg)](https://github.com/Surnet/get-json-matrix)
# Surnet/get-json-matrix
This action gets a GitHub Action Matrix from a JSON.
## Inputs
### `filepath`
The path to the JSON file (defaults to: ./matrix.json)
## Example usage
This runs for the file ./matrix.json in our repository and outputs the
```yaml
name: Run for every X in JSONon:
push:jobs:
get-matrix:
name: Get Matrix from JSON
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3- name: Get Matrix
id: matrix
uses: Surnet/get-json-matrix@v1
with:
filepath: ./matrix.jsonrun-for-everything:
name: Run for each Key Value combination in the JSON
needs: get-matrix
permissions: {}
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }}
steps:
- name: Echo matrix
run: |
echo "${{ matrix.key }}"
echo "${{ matrix.value }}"
```