To pass variable in script you will have to define it in the ENV first then pass the ENV variable in the script
name:Backup Nextcloudon:schedule:# Runs "At 02:01" (see https://crontab.guru) - cron:'1 2 * * *'jobs:ssh:name:Backup Nextcloudruns-on: [self-hosted,linux]env:# This is used to define the environmentSYSTEM_USER:${{ secrets.SYSTEM_USER }}NEXTCLOUD_SCRIPT_PATH:${{ secrets.NEXTCLOUD_SCRIPT_PATH }}steps: - name:SSH and execute Backup Scriptuses:appleboy/ssh-action@masterwith:host:${{ secrets.HOSTNAME }}username:${{ secrets.USERNAME }}key:${{ secrets.SSH_PRIVATE_KEY }}# This is used to pass the variables in the scriptenvs:SYSTEM_USER, NEXTCLOUD_SCRIPT_PATH# This is used to execute the script from variablescript:| sudo bash $NEXTCLOUD_SCRIPT_PATH