Greg_O
Greg_O5mo ago

Code from Buildship docs (setting variables) not working for workflow variables

Hi, I'm reading the docs on using variables (https://docs.buildship.com/env-var). The provided code (for reading, setting and deleting variables) works but only for project variables, the code for workflow variables throws an error ("Couldn't save project environment variables") Example. I use the code from the documentation (see below) and get an error. If I comment out the 2nd line (workflow variable) things work fine. Whatever format I use for the workflow variable code, I keep getting the same error. Any ideas? Variations of the 2nd line await env.set([{ name: 'first', value: 1 }]); await env.set([{ name: 'first', value: 1 },]); await env.set([{ name: 'first', value: 1 },'workflow']); Script (from the website) export default async function testFunctions({ value }, { env }) { await env.set([{ name: 'first', value: 1 }]); // workflow - not working await env.set([{ name: 'third', value: 3 }], 'project'); // project - working fine return true; }
1 Reply
Gaurav Chadha
Gaurav Chadha5mo ago
Hi @Greg_O, We are tracking this issue, will update you on fix, thank you for your patience. 🙂