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
18 changes: 17 additions & 1 deletion .github/workflows/sync-tag-definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,21 @@ jobs:

- name: Generate updated tag_types.py
id: generate
run: python3 scripts/generate_tag_types.py new_tag_types.json
run: |
python3 scripts/generate_tag_types.py new_tag_types.json
rm -f new_tag_types.json

- name: Close existing automated PR
if: steps.generate.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Find and close any existing open PRs on the automated branch
existing_prs=$(gh pr list --repo "${{ github.repository }}" --head "automated/sync-tag-definitions" --state open --json number --jq '.[].number')
for pr_number in $existing_prs; do
echo "Closing existing PR #$pr_number"
gh pr close "$pr_number" --repo "${{ github.repository }}" --comment "Superseded by a newer automated update."
done

- name: Create Pull Request
if: steps.generate.outputs.changed == 'true'
Expand Down Expand Up @@ -63,6 +77,8 @@ jobs:
*This PR was automatically created by the sync-tag-definitions workflow*
branch: 'automated/sync-tag-definitions'
delete-branch: true
add-paths: |
custom_components/opendisplay/tag_types.py
labels: |
automated
dependencies
Expand Down
Loading