You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to parse a github Actions yaml file that has a key named 'on' like shown below:
candidate.yaml
name: action codeon: # this is the key causing the issue, it's translated to 'True' when loaded by pyyamlpush:
branches:
- masterjobs:
build:
runs-on: ubuntu-16.04steps:
# Action Steps
tested on:
Python version: 3.8.6
Ubuntu 20.10
here's the code used:
importyaml# candidate.yaml is the name of the file up abovedata=yaml.load(open('candidate.yaml','r'))
print(yaml.dump(data))
here's the output:
name: action code)true: # here it says 'true' instead of 'on' in the original filepush:
branches:
- masterjobs:
build:
runs-on: ubuntu-16.04steps: null
as you can see the 'on' key has been replaced by 'True' on this file
The text was updated successfully, but these errors were encountered:
This is the expected behavior from a YAML 1.1 compliant library (which pyyaml is). You can modify this behavior by replacing the boolean implicit resolver with one that excludes on and off in a custom loader (or by modifying the existing loaders).
I'm trying to parse a github Actions yaml file that has a key named 'on' like shown below:
candidate.yaml
tested on:
Python version: 3.8.6
Ubuntu 20.10
here's the code used:
here's the output:
as you can see the 'on' key has been replaced by 'True' on this file
The text was updated successfully, but these errors were encountered: