Skip to content

Commit

Permalink
Add workflow to consolidate YAML files and upload as artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-senechal committed Nov 18, 2024
1 parent 2db2c2f commit 37272c8
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/consolidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Consolidate YAML Files

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
consolidate_yaml:
runs-on: ubuntu-22.04

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

- name: Consolidate YAML files
uses: mikefarah/yq@v4
with:
cmd: yq eval-all '. as $item ireduce ([]; . + [$item])' providers/*.yaml > providers.yaml

- name: Upload providers.yaml as artifact
uses: actions/upload-artifact@v4
with:
path: providers.yaml

- name: Commit and push consolidated file
if: github.ref == 'refs/heads/main'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Auto-update providers.yaml"
file_pattern: providers.yaml

0 comments on commit 37272c8

Please sign in to comment.