[PR #223] [MERGED] Implement UnmarshalYAML for ActionRunsUsing #1387

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/223
Author: @mheap
Created: 5/4/2020
Status: Merged
Merged: 5/4/2020
Merged by: @cplee

Base: masterHead: better-runs-using-unmarshalling


📝 Commits (1)

  • 87d5c5a Implement UnmarshalYAML for ActionRunsUsing

📊 Changes

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

View changed files

📝 pkg/model/action.go (+21 -4)
📝 pkg/runner/step_context.go (+1 -1)

📄 Description

In #222 I added case normalisation to ReadAction() to ensure that Docker and docker are interpreted the same way.

I realised that this was being done at the wrong level and required multiple type conversions. By implementing func (a ActionRunsUsing) UnmarshalYAML we can lowercase the string as it's being unserialized

This has an added benefit that any time this type is hydrated the runs.using key will be lowercased, rather than relying on ReadAction()


🔄 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/223 **Author:** [@mheap](https://github.com/mheap) **Created:** 5/4/2020 **Status:** ✅ Merged **Merged:** 5/4/2020 **Merged by:** [@cplee](https://github.com/cplee) **Base:** `master` ← **Head:** `better-runs-using-unmarshalling` --- ### 📝 Commits (1) - [`87d5c5a`](https://github.com/nektos/act/commit/87d5c5a0c0342d51f6e34b248e5ffb7fa4687d79) Implement UnmarshalYAML for ActionRunsUsing ### 📊 Changes **2 files changed** (+22 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `pkg/model/action.go` (+21 -4) 📝 `pkg/runner/step_context.go` (+1 -1) </details> ### 📄 Description In #222 I added case normalisation to ReadAction() to ensure that Docker and docker are interpreted the same way. I realised that this was being done at the wrong level and required multiple type conversions. By implementing `func (a ActionRunsUsing) UnmarshalYAML` we can lowercase the string as it's being unserialized This has an added benefit that any time this type is hydrated the `runs.using` key will be lowercased, rather than relying on `ReadAction()` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:50:57 +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#1387
No description provided.