Idea: Run a command on a PR branch
The bot could accept a mention with a command like
@GiteaBot run `make fmt`
If this exact syntax is matched, check out the branch, run the command, and commit the results with a message run `make fmt` requested by @silverwind. Usage should be restricted to maintainer roles and above.
I'll give it a shot this weekend. Which tools would I need to add to the docker image? Go, Node, Make...?
git, go, node (with npm), make, curl at least. Maybe just use the test_env image which should have all of them.
Unlike a backport, which happens on push this might have a request coming in when a make fmt is already running so I have to think about queuing work as there's only one of these that might run at a time
Could use a temporary label like command/pending to prevent duplicate runs. Also, it serves a double purpose in indicating to users that the command was accepted.
I'm talking about 2 maintainers triggering a command while we only have 1 git repo in the filesystem (we can't use it concurrently). I wonder if there are locks in javascript
I don't suppose these action scripts run all within the same process, right? If so, no amount of in-process lock will help, but if the file system is shared between executions, you could put some sort of lockfile into it.