Home > database >  Warning: Unexpected input(s) ..., valid inputs are [...] in GitHub Actions (full text in the answer
Warning: Unexpected input(s) ..., valid inputs are [...] in GitHub Actions (full text in the answer

Time:02-18

After github action running I got this warning:

Unexpected input(s) 'stack_file_name', valid inputs are ['entryPoint', 'args', 'host', 'port', 'passphrase', 'username', 'password', 'sync', 'use_insecure_cipher', 'cipher', 'timeout', 'command_timeout', 'key', 'key_path', 'fingerprint', 'proxy_host', 'proxy_port', 'proxy_username', 'proxy_password', 'proxy_passphrase', 'proxy_timeout', 'proxy_key', 'proxy_key_path', 'proxy_fingerprint', 'proxy_cipher', 'proxy_use_insecure_cipher', 'script', 'script_stop', 'envs', 'debug']

From main.yml:

runs-on: ubuntu-latest
needs: build_and_push_to_docker_hub
steps:
  - name: executing remote ssh commands to deploy
    uses: appleboy/ssh-action@master
    with:
      host: ${{ secrets.HOST }}
      username: ${{ secrets.USER }}
      key: ${{ secrets.SSH_KEY }}
      passphrase: ${{ secrets.PASSPHRASE }}
      stack_file_name: docker-compose.yaml
      script: |
        sudo docker pull ${{ secrets.DOCKER_USERNAME }}/foodgram
        sudo docker-compose stop
        sudo docker-compose rm web
        touch .env
        echo DB_ENGINE=${{ secrets.DB_ENGINE }} >> .env
        echo DB_NAME=${{ secrets.DB_NAME }} >> .env
        echo POSTGRES_USER=${{ secrets.POSTGRES_USER }} >> .env
        echo POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} >> .env
        echo DB_HOST=${{ secrets.DB_HOST }} >> .env
        echo EMAIL_HOST=${{ secrets.EMAIL_HOST }} >> .env
        echo EMAIL_HOST_USER=${{ secrets.EMAIL_HOST_USER }} >> .env
        echo EMAIL_HOST_PASSWORD=${{ secrets.EMAIL_HOST_PASSWORD }} >> .env
        echo EMAIL_PORT=${{ secrets.EMAIL_PORT }} >> .env
        sudo docker-compose up -d
        sudo docker-compose exec -T web python3 manage.py makemigrations users --no-input
        sudo docker-compose exec -T web python3 manage.py makemigrations recipes --no-input
        sudo docker-compose exec -T web python3 manage.py migrate --no-input
        sudo docker-compose exec -T web python3 manage.py collectstatic --no-input
        sudo docker-compose restart
        sudo docker-compose exec -T web python manage.py loaddata -e=auth -e=contenttypes fixtures.json

And workflow run failed.

What is stack_file_name?

How I can fix this warning?

CodePudding user response:

It's because you informed the stack_file_name: docker-compose.yaml as action input in the workflow implementation you shared. However, as you can check in the action.yml file from the appleboy/ssh-action action, there is no input with that name.

You should use:

runs-on: ubuntu-latest
needs: build_and_push_to_docker_hub
steps:
  - name: executing remote ssh commands to deploy
    uses: appleboy/ssh-action@master
    with:
      host: ${{ secrets.HOST }}
      username: ${{ secrets.USER }}
      key: ${{ secrets.SSH_KEY }}
      passphrase: ${{ secrets.PASSPHRASE }}
      script: |
        ...

Just removing the unnecessary input should resolve your issue.

  • Related