[PR #1252] [MERGED] fix: the number in the github event is of type number #1864

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/1252
Author: @KnisterPeter
Created: 7/12/2022
Status: Merged
Merged: 7/12/2022
Merged by: @mergify[bot]

Base: masterHead: pr-number-is-a-number


📝 Commits (3)

  • e71fc92 fix: the number in the github event is of type number
  • 4fa3f0f test: update test data as well
  • 1e225dd fix: use floats

📊 Changes

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

View changed files

📝 pkg/model/github_context.go (+1 -1)
📝 pkg/model/github_context_test.go (+1 -1)

📄 Description

The go %s formattig option outputs the type if the given input value is not of type string.

fmt.Printf("Number: %s\n", 123) // -> Number: %!s(int=123)
fmt.Printf("Number: %d\n", 123) // -> Number: 123
fmt.Printf("Number: %.0f\n", 123.) // -> Number: 123

Update: The parsed type is float64, therefore we should use float formatting


🔄 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/1252 **Author:** [@KnisterPeter](https://github.com/KnisterPeter) **Created:** 7/12/2022 **Status:** ✅ Merged **Merged:** 7/12/2022 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `pr-number-is-a-number` --- ### 📝 Commits (3) - [`e71fc92`](https://github.com/nektos/act/commit/e71fc924201540d6ac763715de0e0c1a43f4aa7d) fix: the number in the github event is of type number - [`4fa3f0f`](https://github.com/nektos/act/commit/4fa3f0f6ed375ff4cf8e2f9b5b48107dfd4cfb92) test: update test data as well - [`1e225dd`](https://github.com/nektos/act/commit/1e225dd05a1ace545c06600f587a1d7cd4a1a685) fix: use floats ### 📊 Changes **2 files changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `pkg/model/github_context.go` (+1 -1) 📝 `pkg/model/github_context_test.go` (+1 -1) </details> ### 📄 Description The go `%s` formattig option outputs the type if the given input value is not of type string. ```go fmt.Printf("Number: %s\n", 123) // -> Number: %!s(int=123) fmt.Printf("Number: %d\n", 123) // -> Number: 123 fmt.Printf("Number: %.0f\n", 123.) // -> Number: 123 ``` Update: The parsed type is float64, therefore we should use float formatting --- <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:00 +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#1864
No description provided.