Closed cegerhardson closed 1 month ago
I think a variant of this idea might be best:
Another avenue may to be establish a githib workflow that runs on a scheduled
cron
interval, pulls changes from salt usingsalt-cp
, and creates a pull request using create-pull-request action.
I don't think we can use salt-cp
since GitHub Actions runners aren't part of.... and I don't think we want to add them to... our salt installation.
Rather, we could potentially publish files over HTTP from the salt-master that we want to fetch. Similar to the way that we have the salt-master respond to LetsEncrypt acme-challenges in https://github.com/python/psf-salt/blob/24fae9bcff684cf179c61c14dc5f53929e586686/salt/base/salt.sls#L60-L81, we could:
/srv/public
directorypsf_known_hosts
and salt-server-list.rst
managed files to be created in that directoryThen our scheduled GitHub Action can access the files via HTTP, see if they've changed, and use the create-pull-request action to open a PR when they do.
This is complete. https://github.com/python/psf-salt/pull/343
One possible avenue to publish any changes in
salt-server-list.rst
back to ourpython/psf-salt
repository is to:force_reset
parameter to be set to True, allowing it to always stay up to date with the remote repository.file.managed
state would be used to ensure thatsalt-server-list.rst
is present in the local copy of the repository and it's contents are up to date with its source file.git.latest
state, and tracking your file usingfile.managed
you could then use git.push to push any changes to the remote repository.It's important to note that the
user
parameter must have necessary permissions to access the repository. Could possibly create an automated Salt user with limited permissions for the purposes of running these commands and states.Another avenue may to be establish a githib workflow that runs on a scheduled
cron
interval, pulls changes from salt usingsalt-cp
, and creates a pull request using create-pull-request action.