diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7f2a08..52839b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: - uses: actions/checkout@master - name: Gotify Notification uses: eikendev/action-gotify@master - env: + with: gotify_api_base: '${{ secrets.gotify_api_base }}' gotify_app_token: '${{ secrets.gotify_app_token }}' notification_title: 'Build Complete' diff --git a/README.md b/README.md index 920514f..1915b86 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,11 @@ jobs: - uses: actions/checkout@master - name: Gotify Notification uses: eikendev/action-gotify@master - env: + with: gotify_api_base: '${{ secrets.gotify_api_base }}' gotify_app_token: '${{ secrets.gotify_app_token }}' notification_title: 'Build Complete' notification_message: 'Your build was completed.' ``` + +Do not forget to define the secrets so the action can complete successfully. diff --git a/action.yml b/action.yml index ae3ed6b..2fbdeab 100644 --- a/action.yml +++ b/action.yml @@ -22,9 +22,3 @@ inputs: runs: using: 'docker' image: 'Dockerfile' - args: - - ${{ inputs.gotify_api_base }} - - ${{ inputs.gotify_app_token }} - - ${{ inputs.notification_title }} - - ${{ inputs.notification_message }} - - ${{ inputs.notification_priority }} diff --git a/entrypoint.sh b/entrypoint.sh index 1d19611..5b19a4d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,17 +1,6 @@ #!/usr/bin/env sh -if [ $# -ne 5 ]; then - printf "%s\n" "Usage: $0 " >&2 - exit 1 -fi - -gotify_api_base="$1" -gotify_app_token="$2" -notification_title="$3" -notification_message="$4" -notification_priority="$5" - -curl "$gotify_api_base/message?token=$gotify_app_token" \ - -F "title=$notification_title" \ - -F "message=$notification_message" \ - -F "priority=$notification_priority" +curl "$INPUT_GOTIFY_API_BASE/message?token=$INPUT_GOTIFY_APP_TOKEN" \ + -F "title=$INPUT_NOTIFICATION_TITLE" \ + -F "message=$INPUT_NOTIFICATION_MESSAGE" \ + -F "priority=$INPUT_NOTIFICATION_PRIORITY"