adding data to gitea api call function
This commit is contained in:
parent
f06d537ffb
commit
c229c9dd81
12
rtenets
12
rtenets
|
@ -117,9 +117,17 @@ gitea() {
|
||||||
|
|
||||||
local method="$1"
|
local method="$1"
|
||||||
local request="$2"
|
local request="$2"
|
||||||
\curl -X "${request}" \
|
local data=""
|
||||||
|
|
||||||
|
if [[ $# > 3 ]]; then
|
||||||
|
data="$3"
|
||||||
|
fi
|
||||||
|
|
||||||
|
\curl -s -X "${request}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: token ${TOKEN}" "${ENDPOINT}/${method}"
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
-d "${data}" \
|
||||||
|
"${ENDPOINT}/${method}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ----------------- Git commands -----------------------
|
# ----------------- Git commands -----------------------
|
||||||
|
|
Loading…
Reference in New Issue