mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-03 22:34:11 +02:00
Correct Path Filters
This commit is contained in:
37
.github/workflows/onpush_builder.yaml
vendored
37
.github/workflows/onpush_builder.yaml
vendored
@@ -15,14 +15,49 @@ on:
|
|||||||
- "**/config.*"
|
- "**/config.*"
|
||||||
|
|
||||||
jobs:
|
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:
|
check-addon-changes:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: [correct_path_filters]
|
||||||
outputs:
|
outputs:
|
||||||
changedAddons: ${{ steps.filter.outputs.changes }}
|
changedAddons: ${{ steps.filter.outputs.changes }}
|
||||||
steps:
|
steps:
|
||||||
- name: ↩️ Checkout
|
- name: ↩️ Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: 📂 Detect changed files
|
- name: 📂 Detect changed files
|
||||||
uses: dorny/paths-filter@v3
|
uses: dorny/paths-filter@v3
|
||||||
id: filter
|
id: filter
|
||||||
|
|||||||
Reference in New Issue
Block a user