@@ -427,12 +427,33 @@ Brief description of what the action does.
427427
428428# # Common Gotchas
429429
430- 1. **Expression evaluation in descriptions** : Don't use `${{ }}` in action.yml description fields
431- 2. **Race conditions** : Always use optimistic execution + error handling, never check-then-act
432- 3. **Secret exposure** : Never use `secrets[inputs.name]` - always use explicit secret parameters
433- 4. **Branch deletion** : Use `wait-pending-jobs` before merging to prevent failures in non-required jobs
434- 5. **Idempotency** : ` gh pr merge --auto` is NOT idempotent - handle "Merge already in progress" error
435- 6. **TOCTOU vulnerabilities** : State can change between check and action - handle at runtime
430+ 1. **Boolean input comparisons** : GitHub Actions inputs are strongly typed, with no "JS-like" truthy logic
431+ ` ` ` yaml
432+ # ❌ WRONG - Boolean true is NOT equal to string 'true'
433+ on:
434+ workflow_call:
435+ inputs:
436+ enable-feature:
437+ type: boolean
438+ default: true
439+
440+ jobs:
441+ my-job:
442+ if: ${{ inputs.enable-feature == 'true' }} # FALSE when input is boolean true!
443+
444+ # ✅ CORRECT - Handle both boolean and string values
445+ if: ${{ inputs.enable-feature == 'true' || inputs.enable-feature == true }}
446+
447+ # Note: In bash, this works fine because bash converts to string:
448+ if [[ '${{ inputs.enable-feature }}' == 'true' ]]; then # Works in bash
449+ ` ` `
450+
451+ 2. **Expression evaluation in descriptions** : Don't use `${{ }}` in action.yml description fields
452+ 3. **Race conditions** : Always use optimistic execution + error handling, never check-then-act
453+ 4. **Secret exposure** : Never use `secrets[inputs.name]` - always use explicit secret parameters
454+ 5. **Branch deletion** : Use `wait-pending-jobs` before merging to prevent failures in non-required jobs
455+ 6. **Idempotency** : ` gh pr merge --auto` is NOT idempotent - handle "Merge already in progress" error
456+ 7. **TOCTOU vulnerabilities** : State can change between check and action - handle at runtime
436457
437458# # Testing Workflows
438459
0 commit comments