Skip to content

Commit

Permalink
Merge pull request #52 from Snuffy2/config-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
iantrich authored Sep 19, 2022
2 parents acb59b8 + f512b02 commit 5a2da80
Show file tree
Hide file tree
Showing 20 changed files with 1,980 additions and 684 deletions.
13 changes: 13 additions & 0 deletions .github/issue-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mode: auto
silent: true
branchName: full
openDraftPR: true

branches:
- label: bug
skip: false
prefix: bugfix/
name: dev
prTarget: dev
- label: '*'
skip: true
6 changes: 6 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changelog:
exclude:
labels:
- ignore-for-release
- black
- isort
30 changes: 30 additions & 0 deletions .github/workflows/branch_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Draft PR for New Branches
on:
workflow_dispatch:
create:
ref_type: branch
branches-ignore:
- dev
- newdev
jobs:
new_branch_pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.0.2
- name: Show Branch Name
run: echo Branch ${GITHUB_REF##*/}
- name: Create and Checkout New Dev branch
run: git checkout ${GITHUB_REF##*/}
- name: Initialize mandatory git config
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
- name: Create Empty Commit
run: git commit --allow-empty -m "Empty commit"
#- run: echo "commit_count="$(git rev-list --count origin..HEAD)
#- run: echo "commit_count="$(git rev-list --count origin..HEAD) >> $GITHUB_ENV
- name: Create Pull Request
run: gh pr create -d -B dev -b "${GITHUB_REF##*/}" -t "${GITHUB_REF##*/}" --head "${GITHUB_REF##*/}"
env:
GITHUB_TOKEN: ${{ secrets.CPR }}
GH_TOKEN: ${{ secrets.CPR }}
18 changes: 18 additions & 0 deletions .github/workflows/empty_commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Create Empty Commit
on:
workflow_dispatch:
jobs:
create_empty_commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.0.2
- name: Show Branch Name
run: echo Branch ${GITHUB_REF##*/}
- name: Create and Checkout New Dev branch
run: git checkout ${GITHUB_REF##*/}
- name: Initialize mandatory git config
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
- name: Create Empty Commit
run: git commit --allow-empty -m "Empty commit"
14 changes: 14 additions & 0 deletions .github/workflows/hacs_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: HACS Action

on: [workflow_dispatch, pull_request]

jobs:
hacs:
name: HACS Action
runs-on: "ubuntu-latest"
steps:
- name: HACS Action
uses: "hacs/action@main"
with:
category: "integration"
ignore: "brands"
10 changes: 10 additions & 0 deletions .github/workflows/hassfest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Validate with hassfest

on: [workflow_dispatch, pull_request]

jobs:
validate:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- uses: "home-assistant/actions/hassfest@master"
13 changes: 13 additions & 0 deletions .github/workflows/issue_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Create Branch on Assigning Bug Issue
on:
issues:
types: [ assigned ]

jobs:
create_issue_branch_job:
runs-on: ubuntu-latest
steps:
- name: Create Issue Branch
uses: robvanderleek/create-issue-branch@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 changes: 58 additions & 0 deletions .github/workflows/mylint_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: MyLint Code Updater (black, isort, flake8)
on: [workflow_dispatch, pull_request]
jobs:
mylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.0.2
- name: Set up Python environment
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Check code with the Black Code Formatter
uses: rickstaa/action-black@v1.1.14
id: action_black
with:
black_args: "."
fail_on_error: 'true'
- name: Check code with isort
uses: jamescurtin/isort-action@master
id: action_isort
with:
configuration: --force-single-line --profile black
- name: Check code with flake8
uses: reviewdog/action-flake8@v3
id: action_flake8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_error: false
filter_mode: "nofilter"
flake8_args: "--select=F,E7,E9,W1,W6"
- name: Create Pull Request
if: github.event_name == 'pull_request' && (steps.action_black.outputs.is_formatted == 'true' || steps.action_isort.outputs.isort-result)
id: cpr
uses: peter-evans/create-pull-request@v4.1.1
with:
token: ${{ secrets.CPR }}
title: "Format Python code with isort & Black Code Formatter"
commit-message: ":art: Format Python code with isort & Black Code Formatter"
body: |
There appear to be some python formatting errors in ${{ github.sha }}. This pull request
uses the [Black Code Formatter](/~https://github.com/psf/black) and [isort](https://pycqa.github.io/isort) to fix these issues.
labels: "automerge,black,isort"
base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch
delete-branch: true
branch: actions/mylint
- name: Auto Merge
if: ${{ steps.cpr.outputs.pull-request-number }}
id: automerge
uses: pascalgn/automerge-action@v0.15.3
env:
GITHUB_TOKEN: "${{ secrets.CPR }}"
PULL_REQUEST: "${{ steps.cpr.outputs.pull-request-number }}"
MERGE_LABELS: "automerge"
MERGE_METHOD: "squash"
MERGE_REMOVE_LABELS: "automerge"
MERGE_DELETE_BRANCH: "true"
MERGE_ERROR_FAIL: "true"

27 changes: 27 additions & 0 deletions .github/workflows/release_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Create New Dev Branch and PR
on:
workflow_dispatch:
release:
types: [released]
jobs:
new_dev_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.0.2
- name: Create and Checkout New Dev branch
run: git checkout -b dev
- name: Initialize mandatory git config
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
- name: Empty Commit
run: git commit --allow-empty -m "Empty commit"
- name: Push Commit
run: git push --set-upstream origin dev
- name: Create Pull Request
run: gh pr create -d -B ${{ github.event.repository.default_branch }} -l ignore-for-release -b "Dev PR Release" -t "Dev PR Release"
env:
GITHUB_TOKEN: ${{ secrets.CPR }}
GH_TOKEN: ${{ secrets.CPR }}


18 changes: 15 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Pull requests are the best way to propose changes to the codebase.
3. Make sure your code lints (using black).
4. Issue that pull request!

## Any contributions you make will be under the MIT Software License
## Any contributions you make will be under the GPL-3.0 Software License

In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.
In short, when you submit code changes, your submissions are understood to be under the same [License](../../blob/newdev/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern.

## Report bugs using Github's [issues](../../issues)

Expand All @@ -35,16 +35,28 @@ Report a bug by [opening a new issue](../../issues/new/choose); it's that easy!
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- Show logs
- Ideally enable debug logging in Home Assistant
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

People *love* thorough bug reports. I'm not even kidding.

## Enable debug logging in Home Assistant

To enable, add this or modify the logging section of your Home Assistant configuration.yaml:
```yaml
logger:
default: warning
logs:
custom_components.places: debug
```
## Use a Consistent Coding Style
Use [black](/~https://github.com/ambv/black) to make sure the code follows the style.
## License
By contributing, you agree that your contributions will be licensed under its MIT License.
By contributing, you agree that your contributions will be licensed under its GPL-3.0 License.
Loading

0 comments on commit 5a2da80

Please sign in to comment.