From 037f4fbc7438282669154b826d86e3b7dc6cf0e7 Mon Sep 17 00:00:00 2001 From: Snorre Date: Thu, 16 Jan 2025 21:16:42 +0100 Subject: [PATCH] fix: formatting errors --- .github/workflows/discord-notifications.yml | 63 +++++++++++++++++++ game/core/api/speech_to_text/hf_stt.gd | 8 +-- game/core/api/text/ollama.gd | 8 +-- game/core/api/text/open_ai.gd | 8 +-- .../control/inventory_control_grid.gd | 1 - 5 files changed, 75 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/discord-notifications.yml diff --git a/.github/workflows/discord-notifications.yml b/.github/workflows/discord-notifications.yml new file mode 100644 index 0000000..42e2923 --- /dev/null +++ b/.github/workflows/discord-notifications.yml @@ -0,0 +1,63 @@ +name: Discord Notifications + +on: + push: + branches: + - '**' # Notify for all branches + pull_request: + branches: + - '**' # Notify for all PRs + workflow_run: + workflows: ['Generic CI', 'Godot CI', 'Build, Release and Deploy'] + types: + - completed + +jobs: + notify-on-push: + name: Notify on Push + runs-on: ubuntu-latest + steps: + - name: Notify Discord about Commit + uses: tsickert/discord-webhook@v6.0.0 + with: + webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} + embed-title: '🚀 New Commit Pushed!' + embed-description: | + **Commit Message:** ${{ github.event.head_commit.message }} + **Branch:** ${{ github.ref_name }} + **Author:** ${{ github.actor }} + [View Commit](${{ github.event.head_commit.url }}) + embed-color: 3066993 # Blue + + notify-on-completion: + name: Notify on Workflow Completion + runs-on: ubuntu-latest + if: ${{ always() }} # Runs whether the workflow succeeds or fails + steps: + - name: Notify Discord about Workflow Status + uses: tsickert/discord-webhook@v6.0.0 + with: + webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} + embed-title: 'Status: ${{ job.status }} for ${{ github.workflow }}' + embed-description: | + **Repository:** ${{ github.repository }} + **Branch:** ${{ github.ref_name }} + **Triggered by:** ${{ github.actor }} + embed-color: ${{ job.status == 'success' && 3066993 || 15158332 }} # Green for success, Red for failure + + notify-on-failure: + name: Notify on Failure + runs-on: ubuntu-latest + if: ${{ failure() }} + steps: + - name: Notify Discord about Failure + uses: tsickert/discord-webhook@v6.0.0 + with: + webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} + embed-title: '🚨 Workflow Failed!' + embed-description: | + **Workflow:** ${{ github.workflow }} + **Branch:** ${{ github.ref_name }} + **Failed Job:** ${{ github.job }} + **Triggered by:** ${{ github.actor }} + embed-color: 15158332 # Red diff --git a/game/core/api/speech_to_text/hf_stt.gd b/game/core/api/speech_to_text/hf_stt.gd index f9f7cc9..1fd3fa6 100644 --- a/game/core/api/speech_to_text/hf_stt.gd +++ b/game/core/api/speech_to_text/hf_stt.gd @@ -72,14 +72,14 @@ func _handle_stream_chunk(chunk: PackedByteArray) -> void: response = response.strip_edges() # Remove leading and trailing whitespaces, including new lines var data_entries := response.split("\n\n") # Split the body into individual data entries for entry in data_entries: - if !handle_chunk_entry(entry.replace("data: ", "")): + if !_handle_chunk_entry(entry.replace("data: ", "")): return -func handle_chunk_entry(entry: String) -> bool: - Logger.debug("handle_chunk_entry:entry", entry) +func _handle_chunk_entry(entry: String) -> bool: + Logger.debug("_handle_chunk_entry:entry", entry) if entry == "[DONE]": - Logger.debug("handle_chunk_entry:stream_result", _stream_text) + Logger.debug("_handle_chunk_entry:stream_result", _stream_text) _http_stream_client.finish_request() SignalManager.speech_to_text_chunk_added.emit("") return false diff --git a/game/core/api/text/ollama.gd b/game/core/api/text/ollama.gd index 577e687..5a5da10 100644 --- a/game/core/api/text/ollama.gd +++ b/game/core/api/text/ollama.gd @@ -178,14 +178,14 @@ func _handle_stream_chunk(chunk: PackedByteArray) -> void: response = response.strip_edges() # Remove leading and trailing whitespaces, including new lines var data_entries := response.split("\n\n") # Split the body into individual data entries for entry in data_entries: - if !handle_chunk_entry(entry.replace("data: ", "")): + if !_handle_chunk_entry(entry.replace("data: ", "")): return -func handle_chunk_entry(entry: String) -> bool: - Logger.debug("handle_chunk_entry:entry", entry) +func _handle_chunk_entry(entry: String) -> bool: + Logger.debug("_handle_chunk_entry:entry", entry) if entry == "[DONE]": - Logger.debug("handle_chunk_entry:stream_result", _stream_text) + Logger.debug("_handle_chunk_entry:stream_result", _stream_text) _http_stream_client.finish_request() SignalManager.text_chunk_added.emit("") return false diff --git a/game/core/api/text/open_ai.gd b/game/core/api/text/open_ai.gd index f4021d9..ffa6b11 100644 --- a/game/core/api/text/open_ai.gd +++ b/game/core/api/text/open_ai.gd @@ -203,14 +203,14 @@ func _handle_stream_chunk(chunk: PackedByteArray) -> void: response = response.strip_edges() # Remove leading and trailing whitespaces, including new lines var data_entries := response.split("\n\n") # Split the body into individual data entries for entry in data_entries: - if !handle_chunk_entry(entry.replace("data: ", "")): + if !_handle_chunk_entry(entry.replace("data: ", "")): return -func handle_chunk_entry(entry: String) -> bool: - Logger.debug("handle_chunk_entry:entry", entry) +func _handle_chunk_entry(entry: String) -> bool: + Logger.debug("_handle_chunk_entry:entry", entry) if entry == "[DONE]": - Logger.debug("handle_chunk_entry:stream_result", _stream_text) + Logger.debug("_handle_chunk_entry:stream_result", _stream_text) _http_stream_client.finish_request() SignalManager.text_chunk_added.emit("") return false diff --git a/game/interface/inventory/control/inventory_control_grid.gd b/game/interface/inventory/control/inventory_control_grid.gd index 0e57adc..70fca01 100644 --- a/game/interface/inventory/control/inventory_control_grid.gd +++ b/game/interface/inventory/control/inventory_control_grid.gd @@ -114,7 +114,6 @@ var inventory: InventoryGrid: var _inventory_control_item_container: Control var _inventory_control_drop_zone: DropZone var _selected_item: InterfaceInventoryItem - var _field_background_grid: Control var _field_backgrounds: Array var _selection_panel: Panel