Skip to content
Open
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
27 changes: 27 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PlatformIO CI

# Only included into other workflows
on:
workflow_call:


jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Build PlatformIO Project
run: pio run
Comment on lines +12 to +27
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

find .github/workflows -type f -name "*.yaml" -o -name "*.yml"

Repository: MoonModules/MoonLight

Length of output: 179


🏁 Script executed:

cat .github/workflows/build.yaml

Repository: MoonModules/MoonLight

Length of output: 620


🏁 Script executed:

ls -la .github/workflows/

Repository: MoonModules/MoonLight

Length of output: 415


🏁 Script executed:

cat .github/workflows/nightly.yml

Repository: MoonModules/MoonLight

Length of output: 1373


🏁 Script executed:

cat .github/workflows/ci-pio.yaml

Repository: MoonModules/MoonLight

Length of output: 146


🏁 Script executed:

cat .github/workflows/ci.yaml

Repository: MoonModules/MoonLight

Length of output: 645


🏁 Script executed:

# Check if there's a reference to what files PlatformIO actually outputs
rg "\.pio/build" .

Repository: MoonModules/MoonLight

Length of output: 47


🏁 Script executed:

# Check the platformio.ini or similar config to understand the build output
find . -name "platformio.ini" -o -name ".platformio.ini" | head -5

Repository: MoonModules/MoonLight

Length of output: 81


🏁 Script executed:

cat ./platformio.ini

Repository: MoonModules/MoonLight

Length of output: 15425


🏁 Script executed:

# Check the actual project structure to understand build outputs
find . -type d -name "build" -o -type d -name ".pio" | head -10

Repository: MoonModules/MoonLight

Length of output: 47


🏁 Script executed:

# Check if build.yml exists (different from build.yaml)
ls -la .github/workflows/ | grep build

Repository: MoonModules/MoonLight

Length of output: 124


🏁 Script executed:

# Check the nightly.yml more carefully for the exact workflow reference
grep -n "uses:" .github/workflows/nightly.yml

Repository: MoonModules/MoonLight

Length of output: 272


🏁 Script executed:

# Check if there's a build.yml file or if it's just named build.yaml
git ls-files | grep "build\."

Repository: MoonModules/MoonLight

Length of output: 93


🏁 Script executed:

# Double-check the exact reference in ci-pio.yaml too
cat .github/workflows/ci-pio.yaml

Repository: MoonModules/MoonLight

Length of output: 146


🏁 Script executed:

# Check what happens when PlatformIO builds - look for any build output references
rg "firmware" . -t py -t ini -A 2 -B 2

Repository: MoonModules/MoonLight

Length of output: 92


🏁 Script executed:

# Check if there are any scripts that might define the output paths
ls -la scripts/

Repository: MoonModules/MoonLight

Length of output: 577


🏁 Script executed:

cat scripts/rename_fw.py

Repository: MoonModules/MoonLight

Length of output: 2925


🏁 Script executed:

cat scripts/merge_bin.py

Repository: MoonModules/MoonLight

Length of output: 2539


🏁 Script executed:

# Check what files the nightly job expects to download
# Look for any file patterns mentioned
grep -A 5 "Download artifacts" .github/workflows/nightly.yml

Repository: MoonModules/MoonLight

Length of output: 230


🏁 Script executed:

# Check what the actual directory structure would be after pio run + scripts
# Look at what save_elf.py does to understand all outputs
cat scripts/save_elf.py

Repository: MoonModules/MoonLight

Length of output: 1026


🏁 Script executed:

# Check if there are any other workflow files that might be importing or calling build
rg "workflow_call\|reusable" .github/workflows/

Repository: MoonModules/MoonLight

Length of output: 47


🏁 Script executed:

# Verify if GitHub can resolve build.yml to build.yaml by checking git history or any documentation
# For now, let's see all yaml/yml files in the workflows
find .github/workflows -type f \( -name "*.yaml" -o -name "*.yml" \) -exec basename {} \;

Repository: MoonModules/MoonLight

Length of output: 107


🏁 Script executed:

# Check the platformio.ini to see what environment names are being used
# and understand the actual build directory structure that PlatformIO creates
grep "^\[env:" platformio.ini | head -20

Repository: MoonModules/MoonLight

Length of output: 47


🏁 Script executed:

# Check if there's a .gitignore that might tell us what's normally generated
cat .gitignore | grep -E "build|\.pio"

Repository: MoonModules/MoonLight

Length of output: 126


Nightly release will have no binaries without an artifact upload.

The reusable build job never uploads artifacts, but the nightly workflow later downloads artifacts and attaches *.bin files to a release. Add an upload step to make the binaries available to downstream jobs.

The post-build scripts (rename_fw.py, merge_bin.py) output binaries to build/release/ and build/merged/ directories, not .pio/build/.

🔧 Proposed fix (upload build outputs)
       - name: Build PlatformIO Project
         run: pio run
+      - name: Upload build artifacts
+        uses: actions/upload-artifact@v4
+        with:
+          name: platformio-build
+          path: build/**/*.bin
📝 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
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Build PlatformIO Project
run: pio run
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Build PlatformIO Project
run: pio run
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: platformio-build
path: build/**/*.bin
🤖 Prompt for AI Agents
In @.github/workflows/build.yaml around lines 12 - 27, The workflow currently
builds but never uploads artifacts, so downstream jobs (nightly release) find no
binaries; add an upload step after the "Build PlatformIO Project" step that uses
actions/upload-artifact to upload the produced binaries (include paths
build/release/**, build/merged/** and any *.bin outputs) so the nightly workflow
can download them; reference the existing step "Build PlatformIO Project" as the
insertion point and ensure the upload step names the artifact (e.g.,
firmware-binaries) and includes the outputs of the post-build scripts
rename_fw.py and merge_bin.py.

24 changes: 6 additions & 18 deletions .github/workflows/ci-pio.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
name: PlatformIO CI

on: [push]
on:
push:
branches:
- '*'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
uses: ./.github/workflows/build.yml

steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Build PlatformIO Project
run: pio run
43 changes: 43 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

name: Deploy Nightly
on:
# This can be used to automatically publish nightlies at UTC nighttime
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
# This can be used to allow manually triggering nightlies from the web interface
workflow_dispatch:

jobs:
wled_build:
uses: ./.github/workflows/build.yml
nightly:
Comment on lines +10 to +13
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Reusable workflow path is wrong.

build.yml doesn’t exist; the file is build.yaml. This job won’t start until the path is corrected.

🛠️ Proposed fix
   wled_build:
-    uses: ./.github/workflows/build.yml
+    uses: ./.github/workflows/build.yaml
📝 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
jobs:
wled_build:
uses: ./.github/workflows/build.yml
nightly:
jobs:
wled_build:
uses: ./.github/workflows/build.yaml
nightly:
🧰 Tools
🪛 actionlint (1.7.10)

12-12: could not read reusable workflow file for "./.github/workflows/build.yml": open /home/jailuser/git/.github/workflows/build.yml: no such file or directory

(workflow-call)

🤖 Prompt for AI Agents
In @.github/workflows/nightly.yml around lines 10 - 13, The reusable workflow
reference under the wled_build job is pointing to the wrong filename ("uses:
./.github/workflows/build.yml"); update that uses entry to reference the actual
file name ("build.yaml") so the wled_build job uses the correct reusable
workflow (i.e., change the uses value from ./.github/workflows/build.yml to
./.github/workflows/build.yaml).

name: Deploy nightly
runs-on: ubuntu-latest
needs: wled_build
Comment on lines +1 to +16
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Release job likely needs explicit write permissions.

Creating/updating a release requires contents: write; the workflow currently relies on the default (read-only) token permissions.

🔧 Proposed fix
 name: Deploy Nightly
 on:
   schedule:
     - cron: '0 2 * * *' # run at 2 AM UTC
   workflow_dispatch:
+
+permissions:
+  contents: write
📝 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
name: Deploy Nightly
on:
# This can be used to automatically publish nightlies at UTC nighttime
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
# This can be used to allow manually triggering nightlies from the web interface
workflow_dispatch:
jobs:
wled_build:
uses: ./.github/workflows/build.yml
nightly:
name: Deploy nightly
runs-on: ubuntu-latest
needs: wled_build
name: Deploy Nightly
on:
# This can be used to automatically publish nightlies at UTC nighttime
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
# This can be used to allow manually triggering nightlies from the web interface
workflow_dispatch:
permissions:
contents: write
jobs:
wled_build:
uses: ./.github/workflows/build.yml
nightly:
name: Deploy nightly
runs-on: ubuntu-latest
needs: wled_build
🧰 Tools
🪛 actionlint (1.7.10)

12-12: could not read reusable workflow file for "./.github/workflows/build.yml": open /home/jailuser/git/.github/workflows/build.yml: no such file or directory

(workflow-call)

🤖 Prompt for AI Agents
In @.github/workflows/nightly.yml around lines 1 - 16, The workflow’s "nightly"
job needs explicit write permission to create/update releases; update the
workflow to grant the token "contents: write" (either at the top-level
permissions or specifically for the "nightly" job) so the release-related steps
can push changes — target the "nightly" job name in your change and set
permissions for GITHUB_TOKEN accordingly.

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Show Files
run: ls -la
- name: "✏️ Generate release changelog"
id: changelog
uses: janheinrichmerker/action-github-changelog-generator@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
sinceTag: v0.8.0
# Exclude issues that were closed without resolution from changelog
exclude-labels: 'stale,wontfix,duplicate,invalid'
- name: Update Nightly Release
uses: andelf/nightly-release@main
Comment on lines +32 to +33
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/nightly.yml | sed -n '30,35p'

Repository: MoonModules/MoonLight

Length of output: 388


🌐 Web query:

andelf/nightly-release GitHub action releases tags versions

💡 Result:

I couldn’t find a publicly accessible GitHub repository page (or its Releases/Tags) for andelf/nightly-release via web search right now—this typically means the repo is private, renamed, deleted, or otherwise not indexed.

If you do have access, here’s how to determine the Action’s available release versions/tags:

  • On GitHub UI
    • Check the repo’s Releases page (lists released versions like v1.2.3)
    • Check the repo’s Tags page (lists all tags, including moving tags like v1)
  • Via Git CLI (no UI needed)
    • git ls-remote --tags https://github.com/andelf/nightly-release.git
  • Via GitHub CLI
    • gh release list -R andelf/nightly-release

For Actions versioning best practice: publish immutable semver tags (e.g. v1.2.3) and optionally maintain moving major/minor tags (e.g. v1, v1.2) so users can pin safely. GitHub recommends semantic version tags and keeping major/minor tags updated to the latest compatible release. [1] [2]

Sources
[1] https://docs.github.com/en/actions/how-tos/create-and-publish-actions/using-immutable-releases-and-tags-to-manage-your-actions-releases
[2] https://docs.github.com/actions/creating-actions/releasing-and-maintaining-actions


🏁 Script executed:

git ls-remote --tags https://github.com/andelf/nightly-release.git | head -20

Repository: MoonModules/MoonLight

Length of output: 409


Pin andelf/nightly-release to a specific version tag.

Using @main is a supply-chain risk; the action can be updated at any time without notice. Pin to a release tag like @v0.0.4 or @v1, or a full commit SHA.

🔒 Proposed fix (example)
-      - name: Update Nightly Release
-        uses: andelf/nightly-release@main
+      - name: Update Nightly Release
+        uses: andelf/nightly-release@v0.0.4
📝 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
- name: Update Nightly Release
uses: andelf/nightly-release@main
- name: Update Nightly Release
uses: andelf/nightly-release@v0.0.4
🤖 Prompt for AI Agents
In @.github/workflows/nightly.yml around lines 32 - 33, Replace the unpinned
GitHub Action reference "andelf/nightly-release@main" with a pinned release tag
or commit SHA to avoid supply-chain risks; locate the workflow step using the
exact string and change it to a stable tag like "@v0.0.4", a major tag like
"@v1", or a full commit SHA so the action cannot change unexpectedly.

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
name: 'Nightly Release $$'
prerelease: true
body: ${{ steps.changelog.outputs.changelog }}
files: |
*.bin
*.bin.gz