File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,9 +23,12 @@ def main() -> None:
2323 args = parse_args ()
2424
2525 path = args .cla_path
26- signees = json .loads (path .read_text ())
27- signees ["contributors" ].append (args .contributor )
28- signees ["contributors" ].sort (key = str .lower )
26+ try :
27+ signees = json .loads (path .read_text ())
28+ except FileNotFoundError :
29+ signees = []
30+ signees .append (args .contributor )
31+ signees .sort (key = str .lower )
2932 path .write_text (json .dumps (signees , indent = 2 ) + "\n " )
3033
3134
Original file line number Diff line number Diff line change 5757 with :
5858 path : https://raw.githubusercontent.com/${{ inputs.cla_repo }}/main/${{ inputs.cla_path }}
5959 parser : json
60+ default : ' []'
6061
6162 - name : Determine whether the contributor has signed the CLA
62- run : echo HAS_SIGNED=${{ contains(fromJSON(steps.read_cla.outputs.content)['contributors'] , env.CONTRIBUTOR) }} >> $GITHUB_ENV
63+ run : echo HAS_SIGNED=${{ contains(fromJSON(steps.read_cla.outputs.content), env.CONTRIBUTOR) }} >> $GITHUB_ENV
6364 shell : bash
6465
6566 # if contributor has already signed, add [cla-signed] label
You can’t perform that action at this time.
0 commit comments