[PR #628] [MERGED] Fixes #598 #1527

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/628
Author: @Renstrom
Created: 4/22/2021
Status: Merged
Merged: 5/5/2021
Merged by: @cplee

Base: masterHead: master


📝 Commits (7)

  • 848021b Potentially solved merge conflict
  • a7efd1c Update pkg/model/planner.go
  • e9524d9 Merge branch 'master' into master
  • 9c1d87e Fixed compilation error
  • 3fc0cff fixed merge conflicts
  • ef1144e added missed test
  • c8e4c70 Fixed spelling error to work with lint error

📊 Changes

5 files changed (+87 additions, -6 deletions)

View changed files

📝 pkg/model/planner.go (+49 -0)
📝 pkg/model/workflow.go (+2 -2)
📝 pkg/runner/run_context.go (+4 -4)
📝 pkg/runner/runner_test.go (+1 -0)
pkg/runner/testdata/issue-598/spelling.yml (+31 -0)

📄 Description

Issue solution for issue #598

fixes #598

Problem description

This solution fixes issue #598, the problem occurs when the workflow got initiated
model/workflow.go:325 (func ReadWorkFlow()). The reason was due to that the decoder removes the ("") when it got set into the interface.

Solution

This solution ${[ }} to the corners if "" statements exist.
So if the problem is:
"!contains(github.event_name, 'pull_request')"
then the string becomes:
${{ !contains(github.event_name, 'pull_request' }}.
This makes it so the decoder interprets the string to ${{!contains(github.event_name, 'pull_request')}} which solves the issue.

Alternative solution

I tried looking for a way to optimize the code by fixing the yaml decoder, but couldn't find a better solution than this.


🔄 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/628 **Author:** [@Renstrom](https://github.com/Renstrom) **Created:** 4/22/2021 **Status:** ✅ Merged **Merged:** 5/5/2021 **Merged by:** [@cplee](https://github.com/cplee) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (7) - [`848021b`](https://github.com/nektos/act/commit/848021bd0353b01d65e2a75b262645a2ece5a909) Potentially solved merge conflict - [`a7efd1c`](https://github.com/nektos/act/commit/a7efd1c73cb5ee1fb2a07ae9f4c13ad444203808) Update pkg/model/planner.go - [`e9524d9`](https://github.com/nektos/act/commit/e9524d9ea3c5bb44caa955add202d8a0874e24d5) Merge branch 'master' into master - [`9c1d87e`](https://github.com/nektos/act/commit/9c1d87ea6a46327de9eb64a7f6e6562bfde0c8e1) Fixed compilation error - [`3fc0cff`](https://github.com/nektos/act/commit/3fc0cffbcb56771fb83d791a818097df51d5646b) fixed merge conflicts - [`ef1144e`](https://github.com/nektos/act/commit/ef1144ebc45b18ce2c08f36e375e996e0d464d91) added missed test - [`c8e4c70`](https://github.com/nektos/act/commit/c8e4c7088bad2488bcb76d96301a3c7a6e116b57) Fixed spelling error to work with lint error ### 📊 Changes **5 files changed** (+87 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `pkg/model/planner.go` (+49 -0) 📝 `pkg/model/workflow.go` (+2 -2) 📝 `pkg/runner/run_context.go` (+4 -4) 📝 `pkg/runner/runner_test.go` (+1 -0) ➕ `pkg/runner/testdata/issue-598/spelling.yml` (+31 -0) </details> ### 📄 Description # Issue solution for issue [#598](https://github.com/nektos/act/issues/598) fixes #598 ## Problem description This solution fixes issue #598, the problem occurs when the workflow got initiated model/workflow.go:325 (func ReadWorkFlow()). The reason was due to that the decoder removes the ("") when it got set into the interface. ## Solution This solution ${[ }} to the corners if "" statements exist. So if the problem is: "!contains(github.event_name, 'pull_request')" then the string becomes: ${{ !contains(github.event_name, 'pull_request' }}. This makes it so the decoder interprets the string to ${{!contains(github.event_name, 'pull_request')}} which solves the issue. ## Alternative solution I tried looking for a way to optimize the code by fixing the yaml decoder, but couldn't find a better solution than this. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:51:33 +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#1527
No description provided.