Semaphore allows you to change all system configuration settings as a super user. This means that you can use standard bash commands for updating the content of all files from your build commands.
For example, the following command allows you to update your /etc/hosts file:
sudo sh -c "echo 'yourchange' >> /etc/hosts"
As an alternative, you can create a configuration file from the Semaphore interface and then copy or move it to the desired location:
sudo mv /home/runner/my_custom_hosts /etc/hosts
Semaphore Docs are open source — Edit on GitHub