Files
google-labs-jules[bot] faab20ac2f feat: restore .npmrc state at the end of setup-node-environment action
This change modifies the `setup-node-environment` composite action to ensure that any changes made to the `.npmrc` file during the action's execution are reverted at the end.

- **Backup:** At the beginning of the `prepare` step, the existing `.npmrc` is backed up to `.npmrc.action-backup`. If `.npmrc` does not exist, a marker file `.npmrc.was-missing` is created.
- **Restore:** A new step `🧹 恢复 .npmrc` is added at the end of the action. It runs with `if: always()` to guarantee execution even if intermediate steps fail. It either restores `.npmrc` from the backup or deletes it if it was originally missing.

This ensures that the action leaves the environment (specifically the `.npmrc` file) in the same state as it found it, preventing side effects on subsequent workflow steps or jobs.
2025-12-08 22:44:31 +08:00
..