mirror of
https://github.com/huhu/rust-search-extension
synced 2024-11-14 23:57:07 +00:00
Change some workflow action change to workflow_dispatch type
This commit is contained in:
parent
154e8df38e
commit
02362422a9
5 changed files with 4 additions and 54 deletions
3
.github/workflows/build-binary.yml
vendored
3
.github/workflows/build-binary.yml
vendored
|
@ -1,8 +1,7 @@
|
|||
name: build-binary
|
||||
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: build-binary
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
3
.github/workflows/build-index.yml
vendored
3
.github/workflows/build-index.yml
vendored
|
@ -1,7 +1,6 @@
|
|||
name: Build index
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: build-index
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
3
.github/workflows/crates-index.yml
vendored
3
.github/workflows/crates-index.yml
vendored
|
@ -1,8 +1,7 @@
|
|||
name: crates-index
|
||||
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: build-crates-index
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "10 14 * * *"
|
||||
|
||||
|
|
1
.github/workflows/docs.yml
vendored
1
.github/workflows/docs.yml
vendored
|
@ -1,6 +1,7 @@
|
|||
name: docs
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types: deploy-docs
|
||||
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
trigger() {
|
||||
event_type=$1
|
||||
client_payload=$2
|
||||
data="{\"event_type\": \"${event_type}\", \"client_payload\": ${client_payload:-"{}"}}"
|
||||
echo ${data}
|
||||
echo "Triggering action of ${event_type}..."
|
||||
curl -H "Accept: application/vnd.github.everest-preview+json" \
|
||||
-H "Authorization: token ${ACCESS_TOKEN}" \
|
||||
--request POST \
|
||||
--data "${data}" \
|
||||
https://api.github.com/repos/huhu/rust-search-extension/dispatches
|
||||
echo "Trigger action of ${event_type} success!"
|
||||
}
|
||||
|
||||
main() {
|
||||
if [[ -z "${ACCESS_TOKEN}" ]]
|
||||
then
|
||||
echo "Notice: ACCESS_TOKEN environment is required!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
event_types=(0 deploy-docs build-crates-index build-binary build-index)
|
||||
echo "Please select trigger type:"
|
||||
echo "1) ${event_types[1]}"
|
||||
echo "2) ${event_types[2]}"
|
||||
echo "3) ${event_types[3]}"
|
||||
echo "4) ${event_types[4]}"
|
||||
|
||||
read event_index
|
||||
case "${event_index}" in
|
||||
1|2|4)
|
||||
trigger ${event_types[event_index]}
|
||||
;;
|
||||
3)
|
||||
bins=(0 crates-index)
|
||||
echo "Please select crate binary name:"
|
||||
echo "1) ${bins[1]}"
|
||||
read bin_index
|
||||
trigger ${event_types[event_index]} "{\"bin\": \"${bins[bin_index]}\"}"
|
||||
;;
|
||||
*) echo "Invalid options\n";;
|
||||
esac
|
||||
}
|
||||
|
||||
main
|
Loading…
Reference in a new issue