Skip to content

Commit

Permalink
Switch to centralized GitHub Action Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Nov 2, 2021
1 parent cde3757 commit 5603b09
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 171 deletions.
85 changes: 0 additions & 85 deletions .github/labels.yml

This file was deleted.

22 changes: 7 additions & 15 deletions .github/workflows/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@ name: Sync labels

# yamllint disable-line rule:truthy
on:
push:
branches:
- master
paths:
- .github/labels.yml
schedule:
- cron: "34 5 * * *"
workflow_dispatch:

jobs:
labels:
name: ♻️ Sync labels
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🚀 Run Label Syncer
uses: micnncim/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
workflows:
uses: hassio-addons/workflows/.github/workflows/labels.yaml@main
secrets:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 2 additions & 19 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,5 @@ on:
workflow_dispatch:

jobs:
json:
name: JSON Lint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🚀 Run JQ
run: |
shopt -s globstar
cat **/*.json | jq '.'
yamllint:
name: YAMLLint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🚀 Run YAMLLint
uses: frenck/[email protected]
workflows:
uses: hassio-addons/workflows/.github/workflows/repository-lint.yaml@main
15 changes: 4 additions & 11 deletions .github/workflows/lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@ on:
workflow_dispatch:

jobs:
lock:
name: 🔒 Lock closed issues and PRs
runs-on: ubuntu-latest
steps:
- uses: dessant/[email protected]
with:
github-token: ${{ github.token }}
issue-inactive-days: "30"
issue-lock-reason: ""
pr-inactive-days: "1"
pr-lock-reason: ""
workflows:
uses: hassio-addons/workflows/.github/workflows/lock.yaml@main
secrets:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/pr-labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: PR Labels

# yamllint disable-line rule:truthy
on:
pull_request_target:
types:
- opened
- labeled
- unlabeled
- synchronize

jobs:
workflows:
uses: hassio-addons/workflows/.github/workflows/pr-labels.yaml@main
secrets:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 6 additions & 11 deletions .github/workflows/repository-updater.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ on:
types: ["update"]

jobs:
publish:
name: Publish add-on update
runs-on: ubuntu-latest
steps:
- name: 🚀 Run Repository Updater
uses: hassio-addons/[email protected]
with:
addon: ${{ github.event.client_payload.addon }}
repository: ${{ github.repository }}
token: ${{ secrets.UPDATER_TOKEN }}
workflows:
uses: hassio-addons/workflows/.github/workflows/repository-updater.yaml@main
secrets:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPDATER_TOKEN: ${{ secrets.UPDATER_TOKEN }}

announce:
name: Announce add-on update
needs: publish
needs: workflows
runs-on: ubuntu-latest
steps:
- name: 📢 Announce on Discord server
Expand Down
34 changes: 4 additions & 30 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,7 @@ on:
workflow_dispatch:

jobs:
stale:
name: 🧹 Clean up stale issues and PRs
runs-on: ubuntu-latest
steps:
- name: 🚀 Run stale
uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
days-before-close: 7
remove-stale-when-updated: true
stale-issue-label: "stale"
exempt-issue-labels: "no-stale,help-wanted"
stale-issue-message: >
There hasn't been any activity on this issue recently, so we
clean up some of the older and inactive issues.
Please make sure to update to the latest version and
check if that solves the issue. Let us know if that works for you
by leaving a comment 👍
This issue has now been marked as stale and will be closed if no
further activity occurs. Thanks!
stale-pr-label: "stale"
exempt-pr-labels: "no-stale"
stale-pr-message: >
There hasn't been any activity on this pull request recently. This
pull request has been automatically marked as stale because of that
and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.
workflows:
uses: hassio-addons/workflows/.github/workflows/stale.yaml@main
secrets:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
ignore: |
*/translations/*.yaml
*/config.yaml
*/config.yml
rules:
braces:
level: error
Expand Down

0 comments on commit 5603b09

Please sign in to comment.