diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 94d4a6343..e75d6601d 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,8 @@ blank_issues_enabled: false contact_links: + - name: "IMPORTANT: Check development branch changelog first!!" + url: https://github.com/Koenkk/zigbee2mqtt/releases/tag/latest-dev + about: "Before submitting an issue, check if the issue hasn't already been solved in the development branch. Click 'Open' to see the release notes of the development branch. In case it is, you can read here how to switch to the development branch: https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html" - name: Questions/discussion url: https://github.com/Koenkk/zigbee2mqtt/discussions/new about: Ask questions, discuss about devices or show things you made diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81739d96f..5f8072284 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,14 @@ -name: CI +name: ci -on: [push, pull_request] +on: + pull_request: + push: + branches-ignore: + - deps/* permissions: - contents: read + contents: write + pull-requests: write jobs: ci: @@ -12,9 +17,9 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 registry-url: https://registry.npmjs.org/ - cache: 'npm' + cache: npm - name: Install dependencies run: npm ci - name: Build @@ -28,7 +33,7 @@ jobs: run: echo ${{ secrets.DOCKER_KEY }} | docker login -u koenkk --password-stdin - name: Docker login ghcr.io if: (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' - run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u koenkk --password-stdin + run: echo ${{ secrets.GH_TOKEN }} | docker login ghcr.io -u koenkk --password-stdin - name: Docker setup - QEMU if: (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' uses: docker/setup-qemu-action@v2 @@ -73,7 +78,7 @@ jobs: run: | curl \ -X POST \ - -H "Authorization: token ${{ secrets.CR_PAT }}" \ + -H "Authorization: token ${{ secrets.GH_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/zigbee2mqtt/hassio-zigbee2mqtt/actions/workflows/ci.yml/dispatches \ -d '{"ref":"master","inputs":{}}' @@ -95,8 +100,6 @@ jobs: - name: Install dependencies # --ignore-scripts prevents the serialport build which often fails on Windows run: npm ci --ignore-scripts - - name: Lint - run: npm run eslint - name: Build run: npm run build - name: Test diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index b480753f2..15f07a588 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -1,34 +1,23 @@ -name: "Code Scanning - Action" +name: codeql on: - pull_request: push: + branches: + - dev jobs: CodeQL-Build: - # CodeQL runs on ubuntu-latest, windows-latest, and macos-latest runs-on: ubuntu-latest permissions: - # required for all workflows security-events: write steps: - name: Checkout repository uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild uses: github/codeql-action/autobuild@v2 - - #- run: | - # make bootstrap - # make release - - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/depsreview.yaml b/.github/workflows/deps_review.yaml similarity index 91% rename from .github/workflows/depsreview.yaml rename to .github/workflows/deps_review.yaml index defcfabfa..93b96b47a 100644 --- a/.github/workflows/depsreview.yaml +++ b/.github/workflows/deps_review.yaml @@ -1,4 +1,4 @@ -name: 'Dependency review' +name: deps-review on: [pull_request] permissions: diff --git a/.github/workflows/ghcr_cleanup.yml b/.github/workflows/ghcr_cleanup.yml index ccb296e19..31e5789e9 100644 --- a/.github/workflows/ghcr_cleanup.yml +++ b/.github/workflows/ghcr_cleanup.yml @@ -1,7 +1,7 @@ on: workflow_dispatch: -name: GHCR cleanup +name: ghcr-cleanup permissions: {} jobs: @@ -12,7 +12,7 @@ jobs: - name: Delete untagged images uses: actions/github-script@v6 with: - github-token: ${{ secrets.CR_PAT }} + github-token: ${{ secrets.GH_TOKEN }} script: | const response = await github.request("GET /${{ env.OWNER }}/packages/container/${{ env.PACKAGE_NAME }}/versions", { per_page: ${{ env.PER_PAGE }} diff --git a/.github/workflows/release_please.yml b/.github/workflows/release_please.yml index f6587e77e..79d54015d 100644 --- a/.github/workflows/release_please.yml +++ b/.github/workflows/release_please.yml @@ -13,13 +13,18 @@ jobs: release-please: runs-on: ubuntu-latest steps: + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: npm + - uses: google-github-actions/release-please-action@v3 id: release with: release-type: node package-name: release-please-action default-branch: dev - token: ${{secrets.CR_PAT}} + token: ${{secrets.GH_TOKEN}} # Checkout repos - uses: actions/checkout@v3 @@ -54,7 +59,7 @@ jobs: npm ci node scripts/generateChangelog.js $MASTER_Z2M_VERSION $MASTER_ZHC_VERSION $MASTER_ZH_VERSION >> ../changelog env: - GH_TOKEN: ${{secrets.CR_PAT}} + GH_TOKEN: ${{secrets.GH_TOKEN}} - uses: ncipollo/release-action@v1 with: bodyFile: changelog diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 8b73dc8f6..59395bc23 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,17 +1,12 @@ -name: "Close stale issues/pull requests" +name: stale + on: schedule: - cron: "0 0 * * *" workflow_dispatch: -permissions: - contents: read - jobs: stale: - permissions: - issues: write # for actions/stale to close stale issues - pull-requests: write # for actions/stale to close stale PRs runs-on: ubuntu-latest steps: - uses: actions/stale@v8 @@ -21,5 +16,5 @@ jobs: stale-pr-message: 'This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days' days-before-stale: 30 days-before-close: 7 - operations-per-run: 500 exempt-issue-labels: dont-stale + operations-per-run: 500 diff --git a/.github/workflows/update_dep.yml b/.github/workflows/update_dep.yml new file mode 100644 index 000000000..65d0a1cf4 --- /dev/null +++ b/.github/workflows/update_dep.yml @@ -0,0 +1,37 @@ +on: + repository_dispatch: + types: update_dep + +name: update-dep + +permissions: {} +jobs: + update_dep: + permissions: + contents: write + pull-requests: write + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: dev + token: ${{ secrets.GH_TOKEN }} + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: npm + - run: npm install ${{ github.event.client_payload.package }}@${{ github.event.client_payload.version }} --save-exact + - uses: peter-evans/create-pull-request@v5 + id: cpr + with: + commit-message: "fix(ignore): update ${{ github.event.client_payload.package }} to ${{ github.event.client_payload.version }}" + branch: "deps/${{ github.event.client_payload.package }}" + title: Update ${{ github.event.client_payload.package }} to ${{ github.event.client_payload.version }} + - run: sleep 5 # Otherwise pull request may not exist yet causing automerge to fail + - uses: peter-evans/enable-pull-request-automerge@v3 + if: steps.cpr.outputs.pull-request-operation == 'created' + with: + token: ${{ secrets.GH_TOKEN }} + pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} + merge-method: squash diff --git a/.github/workflows/update_deps.yml b/.github/workflows/update_deps.yml index fd7b5ca82..ff1c1fe1d 100644 --- a/.github/workflows/update_deps.yml +++ b/.github/workflows/update_deps.yml @@ -17,14 +17,15 @@ jobs: - uses: actions/checkout@v3 with: ref: dev - ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} + token: ${{ secrets.GH_TOKEN }} - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 + cache: npm - run: npx npm-check-updates -u -x connect-gzip-static # connect-gzip-static only supports node 16 - run: npm install - uses: peter-evans/create-pull-request@v5 with: - commit-message: "feat(ignore): update dependencies" - branch: "update_deps" + commit-message: "fix(ignore): update dependencies" + branch: "deps/all" title: Update dependencies diff --git a/.github/workflows/update_frontend.yml b/.github/workflows/update_frontend.yml deleted file mode 100644 index c04884264..000000000 --- a/.github/workflows/update_frontend.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Update zigbee-frontend -on: - repository_dispatch: - types: update_frontend - -permissions: {} -jobs: - update_frontend: - permissions: - contents: write # to create branch (peter-evans/create-pull-request) - pull-requests: write # to create a PR (peter-evans/create-pull-request) - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: dev - ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} - - uses: actions/setup-node@v3 - with: - node-version: 18 - - run: npm install zigbee2mqtt-frontend@${{ github.event.client_payload.version }} --save-exact - - uses: peter-evans/create-pull-request@v5 - id: cpr - with: - commit-message: "feat(ignore): update zigbee2mqtt-frontend to ${{ github.event.client_payload.version }}" - branch: "update_frontend" - title: Update zigbee-frontend to ${{ github.event.client_payload.version }} - - run: sleep 5 # Otherwise pull request may not exist yet causing automerge to fail - - uses: peter-evans/enable-pull-request-automerge@v3 - if: steps.cpr.outputs.pull-request-operation == 'created' - with: - token: ${{ secrets.CR_PAT }} - pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} - merge-method: squash diff --git a/.github/workflows/update_zh.yml b/.github/workflows/update_zh.yml deleted file mode 100644 index 1127f11de..000000000 --- a/.github/workflows/update_zh.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Update zigbee-herdsman -on: - repository_dispatch: - types: update_zh - -permissions: {} -jobs: - update_zh: - permissions: - contents: write # to create branch (peter-evans/create-pull-request) - pull-requests: write # to create a PR (peter-evans/create-pull-request) - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: dev - ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} - - uses: actions/setup-node@v3 - with: - node-version: 18 - - run: npm install zigbee-herdsman@${{ github.event.client_payload.version }} --save-exact - - uses: peter-evans/create-pull-request@v5 - id: cpr - with: - commit-message: "feat(ignore): update zigbee-herdsman to ${{ github.event.client_payload.version }}" - branch: "update_zh" - title: Update zigbee-herdsman to ${{ github.event.client_payload.version }} - - run: sleep 5 # Otherwise pull request may not exist yet causing automerge to fail - - uses: peter-evans/enable-pull-request-automerge@v3 - if: steps.cpr.outputs.pull-request-operation == 'created' - with: - token: ${{ secrets.CR_PAT }} - pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} - merge-method: squash \ No newline at end of file diff --git a/.github/workflows/update_zhc.yml b/.github/workflows/update_zhc.yml deleted file mode 100644 index 3dc5594ed..000000000 --- a/.github/workflows/update_zhc.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Update zigbee-herdsman-converters -on: - repository_dispatch: - types: update_zhc - -permissions: {} -jobs: - update_zhc: - permissions: - contents: write # to create branch (peter-evans/create-pull-request) - pull-requests: write # to create a PR (peter-evans/create-pull-request) - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: dev - ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} - - uses: actions/setup-node@v3 - with: - node-version: 18 - - run: npm install zigbee-herdsman-converters@${{ github.event.client_payload.version }} --save-exact - - uses: peter-evans/create-pull-request@v5 - id: cpr - with: - commit-message: "feat(ignore): update zigbee-herdsman-converters to ${{ github.event.client_payload.version }}" - branch: "update_zhc" - title: Update zigbee-herdsman-converters to ${{ github.event.client_payload.version }} - - run: sleep 5 # Otherwise pull request may not exist yet causing automerge to fail - - uses: peter-evans/enable-pull-request-automerge@v3 - if: steps.cpr.outputs.pull-request-operation == 'created' - with: - token: ${{ secrets.CR_PAT }} - pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} - merge-method: squash \ No newline at end of file