Search code examples
pythongithubheroku

If I deploy my Twitch bot made in python on Heroku using github when the variables get edited while being used does that reflect in the github code?


I have a variable and a .txt file that are updated via commands in Twitch chat. The bot is made in python. One being a counter that gets added to every time someone does a specific command. Does the counter variable get updated within the code on Github that I am able to see it when checking the code?

Another command adds new words to a .txt file, when someone performs the command to add something would that get added to the .txt file on Github as well or only within the heroku app.

I have tried performing commands but it seems like when I update the counter or add to the .txt it doesn't reflect in github. Is there a way to make it reflect?


Solution

  • Those resources are generated or updated during the execution of your program (here, an Heroku application), which means, by default, their updates are not tracked under source control (in the Heroku app execution environment context), so not visible in GitHub.

    You would need, from your application to call a GitHub Action (pipeline executed on GitHub side), like action-update-file, in order to fetch (curl) and then update your files in your GitHub repository.
    See "How to trigger a Github action with an HTTP request" (from Riku Rouvila) for a practical example of calling a GitHub Action from a program.