update
This commit is contained in:
		@@ -32,19 +32,5 @@ export "LOG_LEVEL=${log_level}"
 | 
			
		||||
# Activate the Ansible virtual environment
 | 
			
		||||
source /opt/ansible-venv/bin/activate
 | 
			
		||||
 | 
			
		||||
# Load configuration from Home Assistant
 | 
			
		||||
GITEA_URL=$(bashio::config 'gitea_url')
 | 
			
		||||
GITEA_TOKEN=$(bashio::config 'gitea_token')
 | 
			
		||||
REPOSITORY=$(bashio::config 'repository')
 | 
			
		||||
ACT_OPTIONS=$(bashio::config 'act_runner_options')
 | 
			
		||||
 | 
			
		||||
# Activate the Ansible virtual environment
 | 
			
		||||
source /opt/ansible-venv/bin/activate
 | 
			
		||||
 | 
			
		||||
# Register Act runner with Gitea (if needed)
 | 
			
		||||
curl -X POST "$GITEA_URL/api/v1/repos/$REPOSITORY/actions/runners" \
 | 
			
		||||
     -H "Authorization: token $GITEA_TOKEN" \
 | 
			
		||||
     -d '{ "name": "Act Runner", "labels": ["self-hosted"] }'
 | 
			
		||||
 | 
			
		||||
bashio::log.info "Handing over control to actrunner..."
 | 
			
		||||
exec /usr/local/bin/act $ACT_OPTIONS
 | 
			
		||||
exec exec /usr/local/bin/act_runner daemon
 | 
			
		||||
@@ -0,0 +1,16 @@
 | 
			
		||||
#!/command/with-contenv bashio
 | 
			
		||||
# shellcheck shell=bash
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
# Home Assistant Community Add-on: Example
 | 
			
		||||
# Example init script, runs before any other service
 | 
			
		||||
# ==============================================================================
 | 
			
		||||
 | 
			
		||||
bashio::log.info "register act_runner !"
 | 
			
		||||
 | 
			
		||||
# Load configuration from Home Assistant
 | 
			
		||||
GITEA_URL=$(bashio::config 'gitea_url')
 | 
			
		||||
GITEA_TOKEN=$(bashio::config 'gitea_token')
 | 
			
		||||
RUNNER_NAME=$(bashio::config 'runner_name')
 | 
			
		||||
RUNNER_LABEL=$(bashio::config 'runner_label')
 | 
			
		||||
 | 
			
		||||
exec /usr/local/bin/act_runner register --no-interactive --instance ${GITEA_URL} --token ${GITEA_TOKEN} --name ${RUNNER_NAME} --labels ${RUNNER_LABEL}
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
oneshot
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
/etc/s6-overlay/s6-rc.d/init-example/run
 | 
			
		||||
		Reference in New Issue
	
	Block a user