[PR #2162] [MERGED] refactor(cmd/root): simplify parseEnvs #2292

Closed
opened 2026-03-01 21:54:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/2162
Author: @Juneezee
Created: 1/20/2024
Status: Merged
Merged: 1/24/2024
Merged by: @mergify[bot]

Base: masterHead: refactor/simplify-parseEnvs


📝 Commits (2)

  • 6c137c7 refactor(cmd/root): simplify parseEnvs
  • 75260b8 Merge branch 'master' into refactor/simplify-parseEnvs

📊 Changes

1 file changed (+11 additions, -15 deletions)

View changed files

📝 cmd/root.go (+11 -15)

📄 Description

Currently parseEnvs accept two parameters:

  1. env []string
  2. envs map[string]string

parseEnvs then do a safety nil check for env.

github.com/nektos/act@15bb54f14e/cmd/root.go (L299-L312)

However, we never pass a nil env to parseEnvs in newRunCommand.

github.com/nektos/act@15bb54f14e/cmd/root.go (L417-L418)

github.com/nektos/act@15bb54f14e/cmd/root.go (L422-L423)

This commit simplify the parseEnvs function to accept just one env []string parameter and return the result as map[string]string instead.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/2162 **Author:** [@Juneezee](https://github.com/Juneezee) **Created:** 1/20/2024 **Status:** ✅ Merged **Merged:** 1/24/2024 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `refactor/simplify-parseEnvs` --- ### 📝 Commits (2) - [`6c137c7`](https://github.com/nektos/act/commit/6c137c726aa3d2f954f34449e65ab8e42ac1cff0) refactor(cmd/root): simplify `parseEnvs` - [`75260b8`](https://github.com/nektos/act/commit/75260b8e96279f247a8e36cfce12614e3ebef0de) Merge branch 'master' into refactor/simplify-parseEnvs ### 📊 Changes **1 file changed** (+11 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `cmd/root.go` (+11 -15) </details> ### 📄 Description Currently `parseEnvs` accept two parameters: 1. `env []string` 2. `envs map[string]string` `parseEnvs` then do a safety `nil` check for `env`. https://github.com/nektos/act/blob/15bb54f14e96734963b78310f0cb8ed0c67e25bb/cmd/root.go#L299-L312 However, we never pass a `nil` `env` to `parseEnvs` in `newRunCommand`. https://github.com/nektos/act/blob/15bb54f14e96734963b78310f0cb8ed0c67e25bb/cmd/root.go#L417-L418 https://github.com/nektos/act/blob/15bb54f14e96734963b78310f0cb8ed0c67e25bb/cmd/root.go#L422-L423 This commit simplify the `parseEnvs` function to accept just one `env []string` parameter and return the result as `map[string]string` instead. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:54:49 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#2292
No description provided.