Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/apollo-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy Apollo M-1 installer Pages

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: apollo-pages
cancel-in-progress: true

jobs:
deploy:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add descriptive names to jobs and steps.

As per path instructions, every workflow, job, and step must have a descriptive name property. Several blocks are missing this attribute.

  • .github/workflows/apollo-pages.yml#L18-L18: Add a name property to the deploy job.
  • .github/workflows/apollo-pages.yml#L24-L24: Add a name property to the checkout step.
  • .github/workflows/apollo-pages.yml#L33-L35: Add a name property to the upload-pages-artifact step.
  • .github/workflows/apollo-pages.yml#L36-L37: Add a name property to the deploy-pages step.
📍 Affects 1 file
  • .github/workflows/apollo-pages.yml#L18-L18 (this comment)
  • .github/workflows/apollo-pages.yml#L24-L24
  • .github/workflows/apollo-pages.yml#L33-L35
  • .github/workflows/apollo-pages.yml#L36-L37
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/apollo-pages.yml at line 18, Add descriptive name
properties to the deploy job and the checkout, upload-pages-artifact, and
deploy-pages steps in .github/workflows/apollo-pages.yml at lines 18-18, 24-24,
33-35, and 36-37 respectively, without changing their existing behavior.

Source: Path instructions

runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a descriptive name to the step.

As per path instructions, every step must have a descriptive name property.

🧰 Tools
🪛 zizmor (1.26.1)

[warning] 24-24: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/apollo-pages.yml at line 24, Add a descriptive name
property to the actions/checkout@v4 step in the workflow, clearly indicating
that it checks out the repository.

Source: Path instructions

- name: Stage manifest and firmware
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir _site
cp apollo/installer/manifest.json _site/manifest.json
gh release download --repo "$GITHUB_REPOSITORY" \
--pattern 'M-1_full_install.bin' --dir _site
Comment on lines +26 to +32

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Specify the release tag when downloading.

If an older historic release is published, gh release download without a tag will blindly download the latest release instead of the one that triggered the workflow. Ensure you download the specific version when triggered by a release.

To safely pass the tag into the script without command injection, it is passed via an env variable. As per path instructions, never interpolate github.event.* values directly into run: steps.

💡 Proposed fix
       - name: Stage manifest and firmware
         env:
           GH_TOKEN: ${{ github.token }}
+          RELEASE_TAG: ${{ github.event.release.tag_name }}
         run: |
           mkdir _site
           cp apollo/installer/manifest.json _site/manifest.json
-          gh release download --repo "$GITHUB_REPOSITORY" \
-            --pattern 'M-1_full_install.bin' --dir _site
+          if [ -z "$RELEASE_TAG" ]; then
+            gh release download --repo "$GITHUB_REPOSITORY" --pattern 'M-1_full_install.bin' --dir _site
+          else
+            gh release download "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" --pattern 'M-1_full_install.bin' --dir _site
+          fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir _site
cp apollo/installer/manifest.json _site/manifest.json
gh release download --repo "$GITHUB_REPOSITORY" \
--pattern 'M-1_full_install.bin' --dir _site
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
mkdir _site
cp apollo/installer/manifest.json _site/manifest.json
if [ -z "$RELEASE_TAG" ]; then
gh release download --repo "$GITHUB_REPOSITORY" --pattern 'M-1_full_install.bin' --dir _site
else
gh release download "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" --pattern 'M-1_full_install.bin' --dir _site
fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/apollo-pages.yml around lines 26 - 32, Update the
release-download step to target the release that triggered the workflow by
passing its tag through a dedicated environment variable and supplying that
variable to gh release download’s tag option. Do not interpolate github.event.*
values directly in the run script; preserve the existing repository, pattern,
and destination arguments.

Source: Path instructions

- uses: actions/upload-pages-artifact@v3
with:
path: _site
- id: deployment
uses: actions/deploy-pages@v4
9 changes: 9 additions & 0 deletions apollo/installer/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Apollo M-1",
"version": "16.0.1",
"home_assistant_domain": "wled",
"new_install_prompt_erase": true,
"builds": [
{ "chipFamily": "ESP32-S3", "parts": [ { "path": "M-1_full_install.bin", "offset": 0 } ] }
]
}
Loading