[PR #1582] [MERGED] feat: allow overriding of GITHUB_ env variables #2014

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/1582
Author: @shubhbapna
Created: 1/24/2023
Status: Merged
Merged: 2/3/2023
Merged by: @mergify[bot]

Base: masterHead: issue-1424


📝 Commits (8)

  • 536d0d7 allow overriding of GITHUB_ env variables
  • e11c99c bug fix for overriding env vars with empty string
  • e59031d revert step.go
  • f960691 refactor github_context to prevent lint failures. added more setters
  • 61da1b1 added ability to override github env variables
  • 1e4399d Merge branch 'master' into issue-1424
  • f3152fb handled base and head ref
  • 1a6d8e2 Merge branch 'master' into issue-1424

📊 Changes

3 files changed (+199 additions, -74 deletions)

View changed files

📝 pkg/model/github_context.go (+65 -6)
📝 pkg/model/github_context_test.go (+94 -25)
📝 pkg/runner/run_context.go (+40 -43)

📄 Description

Fixes #1424

By loading the GITHUB_ env variables before we load the user provided env variables, we can let them override these variables.

I ended up doing a little bit of refactoring as well to keep the linter happy about the cyclomatic complexity of getGithubContext. I shifted the logic of setting some of the variables to github_context.go


🔄 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/1582 **Author:** [@shubhbapna](https://github.com/shubhbapna) **Created:** 1/24/2023 **Status:** ✅ Merged **Merged:** 2/3/2023 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `issue-1424` --- ### 📝 Commits (8) - [`536d0d7`](https://github.com/nektos/act/commit/536d0d731a01f728305547d443e9ea9548caa249) allow overriding of GITHUB_ env variables - [`e11c99c`](https://github.com/nektos/act/commit/e11c99cec1794fa7b8a36817b28b3f5037f452e0) bug fix for overriding env vars with empty string - [`e59031d`](https://github.com/nektos/act/commit/e59031d964a41f4f1655137b10a869654750e7ad) revert step.go - [`f960691`](https://github.com/nektos/act/commit/f960691b42de76d266e8d55d450f241452d09055) refactor github_context to prevent lint failures. added more setters - [`61da1b1`](https://github.com/nektos/act/commit/61da1b1edd561464184f31a5154ac2e15cb1c02b) added ability to override github env variables - [`1e4399d`](https://github.com/nektos/act/commit/1e4399d8931cd7cb2a7c56377c6ac76121552d8a) Merge branch 'master' into issue-1424 - [`f3152fb`](https://github.com/nektos/act/commit/f3152fb1c7051444fe1ec47dc16ffdcb16483b48) handled base and head ref - [`1a6d8e2`](https://github.com/nektos/act/commit/1a6d8e2768940308f05210d948c38fa8544a28af) Merge branch 'master' into issue-1424 ### 📊 Changes **3 files changed** (+199 additions, -74 deletions) <details> <summary>View changed files</summary> 📝 `pkg/model/github_context.go` (+65 -6) 📝 `pkg/model/github_context_test.go` (+94 -25) 📝 `pkg/runner/run_context.go` (+40 -43) </details> ### 📄 Description Fixes #1424 By loading the `GITHUB_` env variables before we load the user provided env variables, we can let them override these variables. I ended up doing a little bit of refactoring as well to keep the linter happy about the cyclomatic complexity of `getGithubContext`. I shifted the logic of setting some of the variables to `github_context.go` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:53:39 +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#2014
No description provided.