Skip to content

Commit

Permalink
Added automated merging of samples
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoabernier committed Jul 28, 2023
1 parent cdea5a2 commit 298d047
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/merge-json-samples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Merge sample metadata

on:
workflow_dispatch:
push:
branches:
# When someone push to `main` branch
- main
paths:
- 'samples/**/assets/sample.json'

jobs:
build:
name: 'Merge all sample.json files to samples.json'
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v2
with:
ref: main
path: main
- name: Join samples
run: |
jq -s '[.[][]]' ./main/samples/**/assets/sample.json > ./main/.metadata/samples.json
- name: Commit samples.json to main
uses: EndBug/add-and-commit@v6
with:
cwd: ./main
branch: main
add: 'main/.metadata/samples.json --force'
push: true
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .metadata/samples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[

]

0 comments on commit 298d047

Please sign in to comment.