Bug: bake fails when Helm Chart source file contains leading (SPDX copyright header) comments
- Dominant language
- TypeScript
- Stars
- 65
- Forks
- 49
- Avg merge
- 9d 9h
- Merged PRs (30d)
- 5
Description
### What happened?
We want our Helm Chart source files to start with SPDX Copyright header files like:
```
#
# SPDX-FileCopyrightText: 2024 XXX
# SPDX-License-Identifier: EUPL-1.2+
#
apiVersion: v1
kind: ServiceAccount
[..]
```
However when we add these to our files the `azure/k8s-bake@v3` fails to bake the Helm Chart because it incorrectly prepends the first line after the comments with a `#` like so:
```
# Source: templates/serviceaccount.yaml
#
# SPDX-FileCopyrightText: 2024 XXX
# SPDX-License-Identifier: EUPL-1.2+
#apiVersion: v1
kind: ServiceAccount
```
This seems a bug to me because comments in Helm Chart yaml files are quite normal and should be supported I think?
### Version
- [x] I am using the latest version
### Runner
ubuntu-latest
### Relevant log output
```
---
# Source: zaakafhandelcomponent/templates/serviceaccount.yaml
#
# SPDX-FileCopyrightText: 2022 Atos, 2024 Lifely
# SPDX-License-Identifier: EUPL-1.2+
#apiVersion: v1
kind: ServiceAccount
```
Contributor guide
Research direction
Start by reproducing the failure with a Helm Chart containing the SPDX comments shown in the issue, then trace the GitHub Action's Helm baking output handling. Done means leading comments remain intact and the apiVersion line is not incorrectly prefixed with #.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, helm, kubernetes, typescript
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100