From 887884faa1438d718736637923ce10cc9251eccb Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Mon, 10 Apr 2023 02:20:51 +0100 Subject: [PATCH 1/7] Fix release script artifacts --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db717f6f2..1c4c39f8f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,8 +69,8 @@ jobs: draft: false prerelease: false files: | - dist/${{ env.ARTIFACT_TGZ }} - dist/${{ env.ARTIFACT_ZIP }} + ${{ env.ARTIFACT_TGZ }} + ${{ env.ARTIFACT_ZIP }} name: "${{ env.VERSION_TAG }}" tag_name: "${{ env.VERSION_TAG }}" target_commitish: ${{ github.event.pull_request.base.ref }} From 48cc9f46af35e07d729752c1fbc8fd9ebbe8ee77 Mon Sep 17 00:00:00 2001 From: Clara K Date: Tue, 11 Apr 2023 17:56:33 +0200 Subject: [PATCH 2/7] correctly crediting nano for his work, not a clown that stole code --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index c9773fdbc..87e6df32e 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -123,7 +123,7 @@ Note: This repo is always updated with OFW & Unleashed. No need to mention all t - Custom subghz presets - Multiple NFC protocols - Multiple Sub-Ghz protocols | Merged from Unleashed, thanks @xMasterX -- Subghz and IR signal replication via gpio | Credits to @ankris812 +- Subghz and IR signal replication via gpio | Credits to @xMasterX - New API Routes for Locale settings ``` From 22482232556f218414f17fee09747ab4f4a394d1 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Sat, 22 Apr 2023 09:06:33 +0100 Subject: [PATCH 3/7] Workflow updates --- .github/workflow_data/discord.py | 45 +++++++++++++++++++++++++++++--- .github/workflows/discord.yml | 4 +-- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/.github/workflow_data/discord.py b/.github/workflow_data/discord.py index 17659f8f7..2b9e29da9 100644 --- a/.github/workflow_data/discord.py +++ b/.github/workflow_data/discord.py @@ -9,7 +9,7 @@ if __name__ == "__main__": with open(os.environ["GITHUB_EVENT_PATH"], "r") as f: event = json.load(f) - webhook = "DEV_DISCORD_WEBHOOK" + webhook = "DEV_WEBHOOK" title = desc = url = "" color = 0 fields = [] @@ -45,7 +45,7 @@ if __name__ == "__main__": title = f"Pull Request {event['action'].title()} ({branch}): {name}" match event["action"]: case "opened": - desc = (event["body"][:2045] + "...") if len(event["body"]) > 2048 else event["body"] + desc = (pr["body"][:2045] + "...") if len(pr["body"]) > 2048 else pr["body"] color = 3669797 fields.append( @@ -80,7 +80,7 @@ if __name__ == "__main__": case "release": match event["action"]: case "published": - webhook = "DEV_DISCORD_WEBHOOK" + webhook = "RELEASE_WEBHOOK" color = 13845998 title = f"New Release published: {event['name']}" desc += f"Changelog:" @@ -123,6 +123,45 @@ if __name__ == "__main__": case _: sys.exit(1) + case "workflow_run": + run = event["workflow_run"] + url = run["html_url"] + title = "Workflow " + match run["conclusion"]: + case "action_required": + title += "Requires Attention" + color = 16751872 + case "failure": + title += "Failed" + color = 16723712 + case _: + sys.exit(0) + title += f": {run['name']}" + + case "issues": + issue = event["issue"] + url = issue["html_url"] + name = issue["title"][:50] + ("..." if len(issue["title"]) > 50 else "") + title = f"Issue {event['action'].title()}: {name}" + match event["action"]: + case "opened": + desc = (issue["body"][:2045] + "...") if len(issue["body"]) > 2048 else issue["body"] + color = 3669797 + case "closed": + color = 16723712 + case "reopened": + color = 16751872 + case _: + sys.exit(1) + + case "issue_comment": + comment = event["comment"] + issue = event["issue"] + url = comment["html_url"] + title = f"New Comment on Issue: {issue['title']}" + color = 3669797 + desc = (comment["body"][:2045] + "...") if len(comment["body"]) > 2048 else comment["body"] + case _: sys.exit(1) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index 8ff4775ac..840f01d67 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -10,7 +10,7 @@ on: release: types: - "published" - check_suite: + workflow_run: types: - "completed" issues: @@ -32,5 +32,5 @@ jobs: - name: Send webhook env: - DEV_DISCORD_WEBHOOK: "https://discord.com/api/webhooks/${{ secrets.DEV_WEBHOOK_ID }}/${{ secrets.DEV_WEBHOOK_TOKEN }}" + DEV_WEBHOOK: "https://discord.com/api/webhooks/${{ secrets.DEV_WEBHOOK_ID }}/${{ secrets.DEV_WEBHOOK_TOKEN }}" run: python .github/workflow_data/discord.py From 85f482fe24f9a3be6d085587dd70498e1ffa7271 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Sat, 22 Apr 2023 09:25:53 +0100 Subject: [PATCH 4/7] Cleanup workflows --- .github/workflow_data/{discord.py => webhook.py} | 0 .github/workflows/build.yml | 4 ++-- .github/workflows/hotfix.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 2 +- .../workflows/{sonarqube.yaml => sonarcloud.yaml} | 4 ++-- .../{check_submodules.yml => submodules.yml} | 4 ++-- .github/workflows/{discord.yml => webhook.yml} | 12 ++++++++++-- 8 files changed, 19 insertions(+), 11 deletions(-) rename .github/workflow_data/{discord.py => webhook.py} (100%) rename .github/workflows/{sonarqube.yaml => sonarcloud.yaml} (98%) rename .github/workflows/{check_submodules.yml => submodules.yml} (96%) rename .github/workflows/{discord.yml => webhook.yml} (73%) diff --git a/.github/workflow_data/discord.py b/.github/workflow_data/webhook.py similarity index 100% rename from .github/workflow_data/discord.py rename to .github/workflow_data/webhook.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 715070b83..37ec991e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: 'Build artifact' +name: 'Build' on: push: @@ -41,7 +41,7 @@ jobs: with: name: updater path: | - dist/${{ env.DEFAULT_TARGET }}-* + dist/${{ env.DEFAULT_TARGET }}-*/${{ env.DEFAULT_TARGET }}-update-*/ # - name: 'Find Previous Comment' # if: ${{ github.event.pull_request }} diff --git a/.github/workflows/hotfix.yml b/.github/workflows/hotfix.yml index 82fb6fa30..505f9c676 100644 --- a/.github/workflows/hotfix.yml +++ b/.github/workflows/hotfix.yml @@ -1,4 +1,4 @@ -name: "Hotfix integration" +name: "Hotfix" on: pull_request_review: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 818aa7d84..da9ca2a87 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: 'Lint formatting' +name: 'Lint' on: push: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c4c39f8f..61bc01fcf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: "Release integration" +name: 'Release' on: pull_request_review: diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarcloud.yaml similarity index 98% rename from .github/workflows/sonarqube.yaml rename to .github/workflows/sonarcloud.yaml index 7f3d311b0..e763aaad7 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -1,4 +1,4 @@ -name: 'SonarCloud analysis' +name: 'SonarCloud' on: workflow_dispatch: @@ -10,7 +10,7 @@ env: DEFAULT_TARGET: f7 jobs: - analyze: + sonarcloud: runs-on: ubuntu-latest env: SONAR_SCANNER_VERSION: 4.7.0.2747 diff --git a/.github/workflows/check_submodules.yml b/.github/workflows/submodules.yml similarity index 96% rename from .github/workflows/check_submodules.yml rename to .github/workflows/submodules.yml index ad63f711b..52342fd04 100644 --- a/.github/workflows/check_submodules.yml +++ b/.github/workflows/submodules.yml @@ -1,4 +1,4 @@ -name: 'Check submodules' +name: 'Submodules' on: push: @@ -10,7 +10,7 @@ on: pull_request: jobs: - check_protobuf: + submodules: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/discord.yml b/.github/workflows/webhook.yml similarity index 73% rename from .github/workflows/discord.yml rename to .github/workflows/webhook.yml index 840f01d67..c3f4d9432 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/webhook.yml @@ -1,4 +1,4 @@ -name: Discord webhook +name: 'Webhook' on: push: @@ -11,6 +11,14 @@ on: types: - "published" workflow_run: + workflows: + - "Build" + - "Hotfix" + - "Lint" + - "Release" + - "SonarCloud" + - "Submodules" + - "Webhook" types: - "completed" issues: @@ -33,4 +41,4 @@ jobs: - name: Send webhook env: DEV_WEBHOOK: "https://discord.com/api/webhooks/${{ secrets.DEV_WEBHOOK_ID }}/${{ secrets.DEV_WEBHOOK_TOKEN }}" - run: python .github/workflow_data/discord.py + run: python .github/workflow_data/webhook.py From b1d916d87f3aed6e762603bf81b7bdfb239edf83 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Sat, 22 Apr 2023 09:26:37 +0100 Subject: [PATCH 5/7] Fix webhook workflow --- .github/workflows/webhook.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/webhook.yml b/.github/workflows/webhook.yml index c3f4d9432..a4e380467 100644 --- a/.github/workflows/webhook.yml +++ b/.github/workflows/webhook.yml @@ -18,7 +18,6 @@ on: - "Release" - "SonarCloud" - "Submodules" - - "Webhook" types: - "completed" issues: From 64453a0b727eb42468ffd8bb695a48a10a640842 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Sun, 23 Apr 2023 17:57:08 +0100 Subject: [PATCH 6/7] Dev webhook fixes --- .github/workflow_data/webhook.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflow_data/webhook.py b/.github/workflow_data/webhook.py index 2b9e29da9..ee97e254b 100644 --- a/.github/workflow_data/webhook.py +++ b/.github/workflow_data/webhook.py @@ -24,12 +24,13 @@ if __name__ == "__main__": else f"{count} New Commit{'' if count == 1 else 's'}" ) desc = f"[**{change}**]({event['compare']}) | [{branch}]({event['repository']['html_url']}/tree/{branch})\n" - for commit in event["commits"][:10]: - msg = commit['message'].splitlines()[0] + for i, commit in enumerate(event["commits"]): + msg = commit['message'].splitlines()[0].replace("`", "") msg = msg[:50] + ("..." if len(msg) > 50 else "") desc += f"\n[`{commit['id'][:7]}`]({commit['url']}): {msg} - [__{commit['author']['username']}__](https://github.com/{commit['author']['username']})" - if count > 10: - desc += f"\n+ {count - 10} more commits" + if len(desc) > 2020: + desc = desc.rsplit("\n", 1)[0] + f"\n+ {count - i} more commits" + break url = event["compare"] color = 16723712 if event["forced"] else 3669797 From 4298aaab02b31ddcd2be7809cfacb6f72ed38ccd Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Tue, 25 Apr 2023 18:40:10 +0100 Subject: [PATCH 7/7] Fix PR webhook --- .github/workflow_data/webhook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflow_data/webhook.py b/.github/workflow_data/webhook.py index ee97e254b..08eab46fb 100644 --- a/.github/workflow_data/webhook.py +++ b/.github/workflow_data/webhook.py @@ -39,7 +39,7 @@ if __name__ == "__main__": url = pr["html_url"] branch = pr["base"]["ref"] + ( "" - if pr["base"]["full_name"] != pr["head"]["full_name"] + if pr["base"]["repo"]["full_name"] != pr["head"]["repo"]["full_name"] else f" <- {pr['head']['ref']}" ) name = pr["title"][:50] + ("..." if len(pr["title"]) > 50 else "")