diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 993a4c8..77787fb 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - - uses: actions/checkout@v4 + uses: actions/checkout@v4 - name: Release uses: softprops/action-gh-release@v2 diff --git a/.gitea/workflows/status.yaml b/.gitea/workflows/status.yaml index cb16f9d..c703766 100644 --- a/.gitea/workflows/status.yaml +++ b/.gitea/workflows/status.yaml @@ -15,8 +15,8 @@ jobs: - name: Webhook uses: zzzze/webhook-trigger@master with: - data: "{\"text\":\"cake-addresses build succeeded\"}" - webhook_url: "https://chat.ops.hipowered.dev/hooks/697436db05042b4dd9cce240/hZCMq7jCPqHprKFcWp3v49wsf4MaN6caWdh7F8iXiSyr6Ts9" + data: "{\"text\":\"${{ gitea.repository }} build succeeded 🎉\"}" + webhook_url: ${{ secrets.BUILD_STATUS_NOTIFY_WEBHOOK_URL }} options: "-H \"Content-Type: application/json\"" on-failure: @@ -26,6 +26,6 @@ jobs: - name: Webhook uses: zzzze/webhook-trigger@master with: - data: "{\"text\":\"cake-addresses build failed\"}" - webhook_url: "https://chat.ops.hipowered.dev/hooks/697436db05042b4dd9cce240/hZCMq7jCPqHprKFcWp3v49wsf4MaN6caWdh7F8iXiSyr6Ts9" + data: "{\"text\":\"${{ gitea.repository }} build failed 🔎\"}" + webhook_url: ${{ secrets.BUILD_STATUS_NOTIFY_WEBHOOK_URL }} options: "-H \"Content-Type: application/json\"" diff --git a/src/Model/Table/AddressesTable.php b/src/Model/Table/AddressesTable.php index 808dae0..4768354 100644 --- a/src/Model/Table/AddressesTable.php +++ b/src/Model/Table/AddressesTable.php @@ -175,11 +175,11 @@ class AddressesTable extends Table { * @return void */ public function beforeMarshal(EventInterface $event, ArrayObject $data, ArrayObject $options): void { - if ($data['state_id'] && !isset($data['state'])) { + if (($data['state_id'] ?? false) && !isset($data['state'])) { $state = $this->States->find()->where(['id' => $data['state_id']])->first(); $data['state'] = $state->name ?? null; } - if ($data['country_id'] && !isset($data['country'])) { + if (($data['country_id'] ?? false) && !isset($data['country'])) { $country = $this->Countries->find()->where(['id' => $data['country_id']])->first(); $data['country'] = $country->name ?? null; }