Skip to content

Set actions/checkout to not persist credentials and improve workflow logic - #798

Merged
JanPetterMG merged 5 commits into
mainfrom
chore/harden-ci-security
Sep 1, 2026
Merged

Set actions/checkout to not persist credentials and improve workflow logic#798
JanPetterMG merged 5 commits into
mainfrom
chore/harden-ci-security

Conversation

@JanPetterMG

Copy link
Copy Markdown
Collaborator

This pull request enhances the security of the CI workflows by disabling credential persistence during the checkout process and refactoring the workflow logic for clarity.

Key changes

  • Set persist-credentials to false in the actions/checkout step across multiple workflows.
  • Utilized environment variables for CLI variables to streamline configuration.
  • Cleaned up workflow logic for better readability.

Impact

These changes improve security by reducing the risk of credential leakage and enhance maintainability of the CI workflows. Users and contributors will benefit from clearer and more secure workflows without any breaking changes.

@JanPetterMG JanPetterMG added chore This issue or pull request is a maintenance task skip-changelog Do not include in release notes labels Aug 31, 2026
@JanPetterMG JanPetterMG added this to the v2.5.2 milestone Aug 31, 2026
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Summary by CodeRabbit

  • Security
    • Improved workflow security by preventing Git credentials from being retained after repository checkout.
  • CI/CD
    • Improved environment handling across automated PlatformIO builds.
    • Updated matrix builds to report results from all environments more reliably.
    • Clang validation now fails consistently when any checks report errors.
    • Standardized automated validation across formatting, linting, building, and publishing workflows.

Walkthrough

The pull request disables persisted Git credentials across GitHub Actions checkout steps. It also routes PlatformIO matrix environments through variables, makes Clang summaries fail on any failed check, and changes ESPHome matrix failure handling.

Changes

Workflow hardening

Layer / File(s) Summary
Disable checkout credential persistence
.github/workflows/*.yml
Checkout steps across the workflows now set persist-credentials: false.
Pass matrix environments through step variables
.github/workflows/clang.yml, .github/workflows/ikea-obegransad-led-wall-lamp.yml
PlatformIO steps assign matrix environments to PIO_ENVIRONMENT and use that variable in build commands.
Tighten generated-build validation
.github/workflows/generate.yml, .github/workflows/ikea-frekvens-led-spotlight.yml
Clang summaries fail when any check fails. The ESPHome matrix limits continued errors to the latest version and uses default fail-fast behavior.

Merge Risk: 🔵 Low · up to 335fc

The workflow matrix may stop validating the latest ESPHome version when another matrix job fails, reducing CI coverage. The PR is mergeable with owner awareness or follow-up to restore fail-fast: false.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the two main changes: disabling credential persistence in actions/checkout and improving workflow logic.
Description check ✅ Passed The description includes the required summary, Key changes, and Impact sections. It accurately covers the security, readability, environment-variable, and workflow-logic updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch chore/harden-ci-security

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JanPetterMG
JanPetterMG marked this pull request as ready for review August 31, 2026 23:38
Copilot AI lite review requested due to automatic review settings August 31, 2026 23:38
@chatgpt-codex-connector

This comment has been minimized.

This comment was marked as off-topic.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 83bc6e39-0dff-4dec-8717-758226c4d9cf

📥 Commits

Reviewing files that changed from the base of the PR and between e57f259 and 730b2dc.

📒 Files selected for processing (15)
  • .github/workflows/biome.yml
  • .github/workflows/clang.yml
  • .github/workflows/dependabot.yml
  • .github/workflows/end-of-life.yml
  • .github/workflows/generate.yml
  • .github/workflows/ikea-frekvens-led-multi-use-light.yml
  • .github/workflows/ikea-frekvens-led-spotlight.yml
  • .github/workflows/ikea-obegransad-led-wall-lamp.yml
  • .github/workflows/labeler.yml
  • .github/workflows/miscellaneous.yml
  • .github/workflows/platformio.yml
  • .github/workflows/ruff.yml
  • .github/workflows/stream.yml
  • .github/workflows/version.yml
  • .github/workflows/wiki.yml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Review details
🧰 Additional context used
🪛 zizmor (1.29.0)
.github/workflows/generate.yml

[info] 58-58: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[info] 137-137: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[info] 200-200: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)

🔇 Additional comments (22)
.github/workflows/biome.yml (2)

21-22: LGTM!


39-40: LGTM!

.github/workflows/clang.yml (5)

23-24: LGTM!


43-44: LGTM!


96-97: LGTM!


113-114: LGTM!


223-223: LGTM!

.github/workflows/dependabot.yml (1)

23-24: LGTM!

.github/workflows/end-of-life.yml (1)

47-48: LGTM!

.github/workflows/ruff.yml (2)

21-22: LGTM!


37-38: LGTM!

.github/workflows/stream.yml (2)

28-29: LGTM!


106-107: LGTM!

.github/workflows/version.yml (1)

29-30: LGTM!

.github/workflows/wiki.yml (1)

26-27: LGTM!

.github/workflows/generate.yml (1)

20-21: LGTM!

Also applies to: 66-67, 137-137, 145-146, 200-200

.github/workflows/ikea-frekvens-led-multi-use-light.yml (1)

28-29: LGTM!

Also applies to: 57-58, 79-80, 96-96, 110-111, 127-128, 153-153, 180-181, 202-203, 289-289, 316-317, 338-339, 457-457

.github/workflows/ikea-frekvens-led-spotlight.yml (1)

23-24: LGTM!

Also applies to: 36-36, 45-46

.github/workflows/ikea-obegransad-led-wall-lamp.yml (1)

28-29: LGTM!

Also applies to: 57-58, 79-80, 95-95, 109-110, 126-127, 152-152, 179-180, 201-202, 285-285, 312-313, 334-335, 452-452

.github/workflows/miscellaneous.yml (1)

20-21: LGTM!

Also applies to: 121-122, 153-154, 186-187, 209-210

.github/workflows/labeler.yml (1)

22-23: LGTM!

.github/workflows/platformio.yml (1)

21-22: LGTM!

Comment thread .github/workflows/generate.yml
Copilot AI review requested due to automatic review settings September 1, 2026 00:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Comment on lines +33 to +36
runs-on: ubuntu-latest
continue-on-error: true

strategy:
fail-fast: false
Copilot AI review requested due to automatic review settings September 1, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 7dd5723a-7513-47e0-83b4-d18f85a7eda1

📥 Commits

Reviewing files that changed from the base of the PR and between bda9b16 and 335fc84.

📒 Files selected for processing (1)
  • .github/workflows/ikea-frekvens-led-spotlight.yml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Review details
⏰ Context from checks skipped due to timeout. (85)
  • GitHub Check: Minimal (lolin_s3_mini)
  • GitHub Check: Minimal (seeed_xiao_esp32c3)
  • GitHub Check: Minimal (esp32-c5-devkitc-1)
  • GitHub Check: Minimal (seeed_xiao_esp32s3)
  • GitHub Check: Minimal (lolin_d32_pro)
  • GitHub Check: Minimal (adafruit_qtpy_esp32s2)
  • GitHub Check: Minimal (adafruit_qtpy_esp32s3_nopsram)
  • GitHub Check: Minimal (esp32-s3-devkitc-1)
  • GitHub Check: Default (lolin_d32)
  • GitHub Check: Minimal (lolin_d32)
  • GitHub Check: Default (esp32dev)
  • GitHub Check: Default (seeed_xiao_esp32c6)
  • GitHub Check: Minimal (seeed_xiao_esp32c6)
  • GitHub Check: Default (lolin_s3_mini)
  • GitHub Check: Minimal (wemos_d1_mini32)
  • GitHub Check: Minimal (esp32-c6-devkitm-1)
  • GitHub Check: Default (wemos_d1_mini32)
  • GitHub Check: Minimal (adafruit_qtpy_esp32s3_n4r2)
  • GitHub Check: Default (seeed_xiao_esp32s3)
  • GitHub Check: Default (lolin_d32_pro)
  • GitHub Check: Minimal (esp32-c3-devkitm-1)
  • GitHub Check: Default (esp32-c6-devkitm-1)
  • GitHub Check: Default (adafruit_qtpy_esp32s3_n4r2)
  • GitHub Check: Default (esp32-c3-devkitm-1)
  • GitHub Check: Default (esp32-c5-devkitc-1)
  • GitHub Check: Default (esp32-s3-devkitc-1)
  • GitHub Check: Default (adafruit_qtpy_esp32s3_nopsram)
  • GitHub Check: Default (adafruit_qtpy_esp32s2)
  • GitHub Check: Minimal (esp32dev)
  • GitHub Check: Default (seeed_xiao_esp32c3)
  • GitHub Check: Typical (seeed_xiao_esp32s3)
  • GitHub Check: Extensive (seeed_xiao_esp32s3)
  • GitHub Check: Typical (esp32-s3-devkitc-1)
  • GitHub Check: Typical (adafruit_qtpy_esp32s3_nopsram)
  • GitHub Check: Extensive (esp32-s3-devkitc-1)
  • GitHub Check: Extensive (adafruit_qtpy_esp32s3_nopsram)
  • GitHub Check: Minimal (lolin_d32)
  • GitHub Check: Default (lolin_d32_pro)
  • GitHub Check: Minimal (seeed_xiao_esp32c3)
  • GitHub Check: Minimal (lolin_s3_mini)
  • GitHub Check: Minimal (seeed_xiao_esp32c6)
  • GitHub Check: Minimal (esp32-c3-devkitm-1)
  • GitHub Check: Default (esp32-s3-devkitc-1)
  • GitHub Check: Minimal (esp32dev)
  • GitHub Check: Default (esp32-c6-devkitm-1)
  • GitHub Check: Minimal (wemos_d1_mini32)
  • GitHub Check: Minimal (lolin_d32_pro)
  • GitHub Check: Minimal (seeed_xiao_esp32s3)
  • GitHub Check: Default (seeed_xiao_esp32s3)
  • GitHub Check: Default (seeed_xiao_esp32c3)
  • GitHub Check: Default (seeed_xiao_esp32c6)
  • GitHub Check: Default (lolin_s3_mini)
  • GitHub Check: Minimal (esp32-s3-devkitc-1)
  • GitHub Check: Default (esp32-c5-devkitc-1)
  • GitHub Check: Minimal (esp32-c5-devkitc-1)
  • GitHub Check: Default (wemos_d1_mini32)
  • GitHub Check: Minimal (adafruit_qtpy_esp32s3_n4r2)
  • GitHub Check: Minimal (esp32-c6-devkitm-1)
  • GitHub Check: Default (adafruit_qtpy_esp32s3_n4r2)
  • GitHub Check: Default (adafruit_qtpy_esp32s2)
  • GitHub Check: Minimal (adafruit_qtpy_esp32s2)
  • GitHub Check: Default (lolin_d32)
  • GitHub Check: Default (adafruit_qtpy_esp32s3_nopsram)
  • GitHub Check: Minimal (adafruit_qtpy_esp32s3_nopsram)
  • GitHub Check: Default (esp32-c3-devkitm-1)
  • GitHub Check: Default (esp32dev)
  • GitHub Check: Extensive (seeed_xiao_esp32s3)
  • GitHub Check: Typical (adafruit_qtpy_esp32s3_nopsram)
  • GitHub Check: Extensive (adafruit_qtpy_esp32s3_nopsram)
  • GitHub Check: Extensive (esp32-s3-devkitc-1)
  • GitHub Check: Typical (seeed_xiao_esp32s3)
  • GitHub Check: Typical (esp32-s3-devkitc-1)
  • GitHub Check: Tidy (IKEA_FREKVENS, esp32-c6-devkitm-1)
  • GitHub Check: Tidy (IKEA_OBEGRANSAD, esp32-c3-devkitm-1)
  • GitHub Check: Tidy (IKEA_FREKVENS, esp32-c5-devkitc-1)
  • GitHub Check: Tidy (IKEA_FREKVENS, esp32-c3-devkitm-1)
  • GitHub Check: Tidy (IKEA_OBEGRANSAD, esp32dev)
  • GitHub Check: Tidy (IKEA_OBEGRANSAD, esp32-c5-devkitc-1)
  • GitHub Check: Tidy (IKEA_OBEGRANSAD, esp32-c6-devkitm-1)
  • GitHub Check: Tidy (IKEA_OBEGRANSAD, esp32-s3-devkitc-1)
  • GitHub Check: Tidy (IKEA_FREKVENS, esp32dev)
  • GitHub Check: Tidy (IKEA_FREKVENS, esp32-s3-devkitc-1)
  • GitHub Check: copilot-pull-request-reviewer
  • GitHub Check: ESPHome (2025.7.0)
  • GitHub Check: ESPHome (latest)
🔇 Additional comments (1)
.github/workflows/ikea-frekvens-led-spotlight.yml (1)

23-24: LGTM!

Also applies to: 45-46

Comment thread .github/workflows/ikea-frekvens-led-spotlight.yml
@JanPetterMG
JanPetterMG added this pull request to the merge queue Sep 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 1, 2026
@JanPetterMG
JanPetterMG added this pull request to the merge queue Sep 1, 2026
Merged via the queue into main with commit 96c1416 Sep 1, 2026
119 checks passed
@JanPetterMG
JanPetterMG deleted the chore/harden-ci-security branch September 1, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore This issue or pull request is a maintenance task skip-changelog Do not include in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants