[PR #752] [MERGED] Fix format function {{, }} are escapes #1590

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/752
Author: @ChristopherHX
Created: 7/16/2021
Status: Merged
Merged: 8/9/2021
Merged by: @mergify[bot]

Base: masterHead: fix/format-escapes


📝 Commits (2)

  • 222c4dd Fix format function {{, }} are escapes
  • cd7ed35 Update format function added 2 error checks

📊 Changes

2 files changed (+38 additions, -6 deletions)

View changed files

📝 pkg/runner/expression.go (+30 -6)
📝 pkg/runner/expression_test.go (+8 -0)

📄 Description

Github transforms multiple expressions into one format expression while parsing and every non expression { is replaced by {{ and } by }}.

I assume vmformat should mimic githubs behavior, issues appeard during testing of https://github.com/ChristopherHX/github-actions-act-runner.

Haven't searched any documentation about this yet.

Some corner cases fixed too
format('{0}', github.undefined_value) should be an empty string not undefined.
format('{0}', '{1}', 'Hello') should be {1} not Hello.

How do I test the error handler?
vmFormat has no error output, so the tests cannot test for error messages or did I miss something?


🔄 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/752 **Author:** [@ChristopherHX](https://github.com/ChristopherHX) **Created:** 7/16/2021 **Status:** ✅ Merged **Merged:** 8/9/2021 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `fix/format-escapes` --- ### 📝 Commits (2) - [`222c4dd`](https://github.com/nektos/act/commit/222c4dd02b327fa531ce60965cc940486c09b053) Fix format function {{, }} are escapes - [`cd7ed35`](https://github.com/nektos/act/commit/cd7ed35f8d1770886c185eeb4772b69c60b0c666) Update format function added 2 error checks ### 📊 Changes **2 files changed** (+38 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `pkg/runner/expression.go` (+30 -6) 📝 `pkg/runner/expression_test.go` (+8 -0) </details> ### 📄 Description Github transforms multiple expressions into one format expression while parsing and every non expression `{` is replaced by `{{` and `}` by `}}`. I assume vmformat should mimic githubs behavior, issues appeard during testing of https://github.com/ChristopherHX/github-actions-act-runner. Haven't searched any documentation about this yet. Some corner cases fixed too `format('{0}', github.undefined_value)` should be an empty string not `undefined`. `format('{0}', '{1}', 'Hello')` should be `{1}` not `Hello`. How do I test the error handler? vmFormat has no error output, so the tests cannot test for error messages or did I miss something? --- <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: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#1590
No description provided.