-
Notifications
You must be signed in to change notification settings - Fork 560
Closed
Labels
Description
I'm trying to parse a github Actions yaml file that has a key named 'on' like shown below:
candidate.yaml
name: action code
on: # this is the key causing the issue, it's translated to 'True' when loaded by pyyaml
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-16.04
steps:
# Action Steps
tested on:
Python version: 3.8.6
Ubuntu 20.10
here's the code used:
import yaml
# candidate.yaml is the name of the file up above
data = 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 file
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-16.04
steps: nullas you can see the 'on' key has been replaced by 'True' on this file