'Is there a way to use NodeJS to append to a github file with github actions?

I have github actions setup on my repo but I have this:

   // make a socket.io for a connection
   // fs
   // prefix (t!), stuff

   socket.on('message', function(data) {
     // args, you know...
     // bot help
     } else if (data.msg.startsWith(command("req"))) {
          fs.appendFile('requests.txt', args + "\n", err => {
             if (err) {
                client.send("Did you know that *" + err + "*?")
                return
             }
             client.send("Done!")
          })
        } else { // invalid handler }
   })

What it should do was that in this website it connects as a bot, and when somebody sent "t!req" it gets the arguments of the message and writes it to a file named "requests.txt", but in reality (the repo) it's the same file as before. Is there a solution, or way, to ACTUALLY write it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source