From 42abcb9e3b67443e75af2218962c88ea3fc70c2a Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 31 Mar 2025 00:30:38 -0700 Subject: [PATCH 1/3] Trying again with the yaml secrets file now --- .github/workflows/build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43e52e7..2016798 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,11 @@ on: required: false type: string default: "" + secrets-environment: + description: Environment to use to access secrets + required: false + type: string + default: "" outputs: version: @@ -72,6 +77,8 @@ jobs: name: ${{ matrix.file }} needs: [prepare] runs-on: ubuntu-latest + environment: + name: ${{ inputs.secrets-environment }} strategy: fail-fast: false max-parallel: 3 @@ -80,6 +87,10 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4.2.2 + - name: Configure secrets.yaml file + if: ${{ inputs.secrets-environment != '' }} + id: decode-base64 + run: echo "${{ secrets.ESPHOME_SECRETS_YAML }}" | base64 -d > $(dirname ${{ matrix.file }})/secrets.yaml - name: Replace project version run: | sed -i "s/version: dev/version: ${{ needs.prepare.outputs.version }}/g" ${{ matrix.file }} From 548b3e43349cb0eaad85c30d1898408eb6da6ab0 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Mon, 31 Mar 2025 00:38:57 -0700 Subject: [PATCH 2/3] Trying again with readme changes too --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index f1b9923..550f73f 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,25 @@ This repository contains workflows to be used by other repositories. See https://github.com/esphome/esphome-project-template for usage of these workflows + +## Secrets file + +The `secrets.yaml` file can be injected into the build as a GitHub Action secret. + +To do so, create a file like something below: + +```yaml +wifi_ssid: MyWiFi +wifi_password: mywifipassword + +# For more on this, see docs: https://esphome.io/components/api.html#configuration-variables +encryption_key: "QQXcWdXZzCuNT3tTtU33nTiqvxkbR1nWIf4lh6W8MA0=" +``` + +Then base64 encode it and upload it the environment provided with the name `ESPHOME_SECRETS_YAML` and the value base64 encoded. + +On macOS, to base64 encode quickly: + +``` +pbpaste | base64 | pbcopy +``` From aca3a7dbee7159b05fd258138339fc88247609bd Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sat, 30 Aug 2025 18:33:35 -0700 Subject: [PATCH 3/3] Fix another unintended change --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 072cdd1..6bc5dfd 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ This repository contains workflows to be used by other repositories. - `promote-r2.yml` - Promote R2 releases - `lock.yml` - Lock workflow + ## Usage See https://github.com/esphome/esphome-project-template for usage of these workflows.