diff --git a/.github/workflows/onpush_builder.yaml b/.github/workflows/onpush_builder.yaml index 6329a9fe3..52f4bb620 100644 --- a/.github/workflows/onpush_builder.yaml +++ b/.github/workflows/onpush_builder.yaml @@ -15,14 +15,49 @@ on: - "**/config.*" jobs: + correct_path_filters: + runs-on: ubuntu-latest + steps: + - name: ↩️ Checkout + uses: actions/checkout@v4 + - name: Update path_filters + run: | + # Init + echo "Starting" + + # Go through all folders, add to filters if not existing + for f in $( find -- * -maxdepth 0 -type d | sort -r ); do + if [ -f "$f"/config.json ]; then + + # Add to file + if ! grep "$f:" ".github/paths-filter.yml"; then + echo "$f: $f/config.*" >> ".github/paths-filter.yml" + fi + + # Identify addons with true images + if [ "$(jq '.image' "$f/config.json")" != null ]; then + sed -i "/$f/ s/ # Image : yes//g" ".github/paths-filter.yml" + sed -i "/$f/ s/$/ # Image : yes/" ".github/paths-filter.yml" + fi + fi + done + + # Sort yaml + sort -t= ".github/paths-filter.yml" -o ".github/paths-filter.yml" + - name: Commit if needed + uses: EndBug/add-and-commit@v9 + with: + commit: -u + message: "GitHub bot : scripts executable" + default_author: github_actions check-addon-changes: runs-on: ubuntu-latest + needs: [correct_path_filters] outputs: changedAddons: ${{ steps.filter.outputs.changes }} steps: - name: ↩️ Checkout uses: actions/checkout@v4 - - name: 📂 Detect changed files uses: dorny/paths-filter@v3 id: filter