Rework action inputs
This commit is contained in:
parent
21dbc832c5
commit
b678edfef1
4 changed files with 8 additions and 23 deletions
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
@ -7,7 +7,7 @@ jobs:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Gotify Notification
|
- name: Gotify Notification
|
||||||
uses: eikendev/action-gotify@master
|
uses: eikendev/action-gotify@master
|
||||||
env:
|
with:
|
||||||
gotify_api_base: '${{ secrets.gotify_api_base }}'
|
gotify_api_base: '${{ secrets.gotify_api_base }}'
|
||||||
gotify_app_token: '${{ secrets.gotify_app_token }}'
|
gotify_app_token: '${{ secrets.gotify_app_token }}'
|
||||||
notification_title: 'Build Complete'
|
notification_title: 'Build Complete'
|
||||||
|
|
|
@ -45,9 +45,11 @@ jobs:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Gotify Notification
|
- name: Gotify Notification
|
||||||
uses: eikendev/action-gotify@master
|
uses: eikendev/action-gotify@master
|
||||||
env:
|
with:
|
||||||
gotify_api_base: '${{ secrets.gotify_api_base }}'
|
gotify_api_base: '${{ secrets.gotify_api_base }}'
|
||||||
gotify_app_token: '${{ secrets.gotify_app_token }}'
|
gotify_app_token: '${{ secrets.gotify_app_token }}'
|
||||||
notification_title: 'Build Complete'
|
notification_title: 'Build Complete'
|
||||||
notification_message: 'Your build was completed.'
|
notification_message: 'Your build was completed.'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Do not forget to define the secrets so the action can complete successfully.
|
||||||
|
|
|
@ -22,9 +22,3 @@ inputs:
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
args:
|
|
||||||
- ${{ inputs.gotify_api_base }}
|
|
||||||
- ${{ inputs.gotify_app_token }}
|
|
||||||
- ${{ inputs.notification_title }}
|
|
||||||
- ${{ inputs.notification_message }}
|
|
||||||
- ${{ inputs.notification_priority }}
|
|
||||||
|
|
|
@ -1,17 +1,6 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
if [ $# -ne 5 ]; then
|
curl "$INPUT_GOTIFY_API_BASE/message?token=$INPUT_GOTIFY_APP_TOKEN" \
|
||||||
printf "%s\n" "Usage: $0 <gotify_api_base> <gotify_app_token> <notification_title> <notification_message> <notification_priority>" >&2
|
-F "title=$INPUT_NOTIFICATION_TITLE" \
|
||||||
exit 1
|
-F "message=$INPUT_NOTIFICATION_MESSAGE" \
|
||||||
fi
|
-F "priority=$INPUT_NOTIFICATION_PRIORITY"
|
||||||
|
|
||||||
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"
|
|
||||||
|
|
Loading…
Reference in a new issue