Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 30 additions & 21 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@ on:
- opened
- synchronize
- reopened
- labeled
- unlabeled
branches:
- master
Comment thread
ludeeus marked this conversation as resolved.
paths:
- appdaemon
- integration
- plugin
- python_script
- template
- theme

concurrency:
group: checks-${{ github.ref }}
Expand All @@ -30,39 +24,54 @@ jobs:
outputs:
repository: ${{ steps.repository.outputs.repository }}
category: ${{ steps.category.outputs.category }}
removal: ${{ steps.removal.outputs.removal }}
run_type: ${{ steps.run_type.outputs.run_type }}
steps:
Comment thread
ludeeus marked this conversation as resolved.
- name: Determine run type
id: run_type
env:
HAS_REMOVAL: ${{ contains(github.event.pull_request.labels.*.name, 'remove-repositories') }}
HAS_NEW_REPO: ${{ contains(github.event.pull_request.labels.*.name, 'New default repository') }}
HAS_RENAMED: ${{ contains(github.event.pull_request.labels.*.name, 'renamed-repositories') }}
run: |
if [ "$HAS_NEW_REPO" == "true" ]; then
echo "run_type=new-repository" >> $GITHUB_OUTPUT
elif [ "$HAS_RENAMED" == "true" ]; then
echo "run_type=rename" >> $GITHUB_OUTPUT
elif [ "$HAS_REMOVAL" == "true" ]; then
echo "run_type=removal" >> $GITHUB_OUTPUT
else
echo "run_type=unknown" >> $GITHUB_OUTPUT
fi
Comment thread
ludeeus marked this conversation as resolved.
Comment thread
ludeeus marked this conversation as resolved.

- name: Check out repository
if: steps.run_type.outputs.run_type == 'new-repository'
uses: actions/checkout@v6.0.2

- name: Set up Python
if: steps.run_type.outputs.run_type == 'new-repository'
uses: actions/setup-python@v6.2.0
with:
python-version-file: ".python-version"

- name: Clone origin
if: steps.run_type.outputs.run_type == 'new-repository'
run: git clone --depth 1 https://github.com/hacs/default /tmp/repositories/default

- name: Set repository
id: repository
if: steps.run_type.outputs.run_type == 'new-repository'
run: echo "repository=$(python3 -m scripts.changed.repo)" >> $GITHUB_OUTPUT

- name: Set category
id: category
if: steps.run_type.outputs.run_type == 'new-repository'
run: echo "category=$(python3 -m scripts.changed.category)" >> $GITHUB_OUTPUT

- name: Check removal
id: removal
run: |
if [ "${{ steps.repository.outputs.repository }}" == "Bad data []" ]; then
echo "removal=true" >> $GITHUB_OUTPUT
fi

owner:
runs-on: ubuntu-latest
name: Owner
needs: preflight
if: needs.preflight.outputs.removal != 'true'
if: needs.preflight.outputs.run_type == 'new-repository'
steps:
- name: Check out repository
uses: actions/checkout@v6.0.2
Expand Down Expand Up @@ -108,7 +117,7 @@ jobs:
runs-on: ubuntu-latest
name: Releases
needs: preflight
if: needs.preflight.outputs.removal != 'true'
if: needs.preflight.outputs.run_type == 'new-repository'
steps:
- name: Check out repository
uses: actions/checkout@v6.0.2
Expand All @@ -133,7 +142,7 @@ jobs:
runs-on: ubuntu-latest
name: Removed repository
needs: preflight
if: needs.preflight.outputs.removal != 'true'
if: needs.preflight.outputs.run_type == 'new-repository'
steps:
- name: Check out repository
uses: actions/checkout@v6.0.2
Expand All @@ -157,7 +166,7 @@ jobs:
runs-on: ubuntu-latest
name: Existing repository
needs: preflight
if: needs.preflight.outputs.removal != 'true'
if: needs.preflight.outputs.run_type == 'new-repository'
steps:
- name: Check out repository
uses: actions/checkout@v6.0.2
Expand All @@ -181,7 +190,7 @@ jobs:
runs-on: ubuntu-latest
name: Hassfest
needs: preflight
if: needs.preflight.outputs.category == 'integration' && needs.preflight.outputs.removal != 'true'
if: needs.preflight.outputs.category == 'integration' && needs.preflight.outputs.run_type == 'new-repository'
steps:
- name: Check out repository
uses: actions/checkout@v6.0.2
Expand All @@ -202,7 +211,7 @@ jobs:
runs-on: ubuntu-latest
name: HACS action
needs: preflight
if: needs.preflight.outputs.removal != 'true'
if: needs.preflight.outputs.run_type == 'new-repository'
steps:
- name: HACS action
uses: hacs/action@main
Expand Down
Loading