[med-svn] [Git][med-team/community/helper-scripts][master] No use of token to find group ID
Steffen Möller
gitlab at salsa.debian.org
Mon Sep 9 15:36:59 BST 2019
Steffen Möller pushed to branch master at Debian Med / community / helper-scripts
Commits:
5681ab91 by Steffen Moeller at 2019-09-09T14:36:23Z
No use of token to find group ID
- - - - -
1 changed file:
- inject-into-salsa-git
Changes:
=====================================
inject-into-salsa-git
=====================================
@@ -4,8 +4,7 @@
set -e
-if [ -n "$1" -a "-h" = "$1" -o "--help" = "$1" ] ; then
-
+help() {
cat <<EOHELP
Usage: $(basename $0)
@@ -23,9 +22,15 @@ SALSA_TOKEN="YOUR_SALSA_TOKEN"
EOSALSATOKEN
and this will be found by this script when executed.
+See https://salsa.debian.org/profile/personal_access_tokens to learn how these
+can be created.
EOHELP
+}
+
+if [ "-h"="$1" -o "--help"="$1" ] ; then
+ help
exit
fi
@@ -34,19 +39,16 @@ set -u
SALSARC=~/.ssh/salsarc
if [ ! -f $SALSARC ] ; then
- echo "Missing ${SALSARC}"
- echo "Just create one containing"
- echo 'SALSA_URL="https://salsa.debian.org/api/v4"'
- echo 'SALSA_TOKEN="YOUR_SALSA_TOKEN"'
+ echo "E: Missing ${SALSARC}. Reread help to create that file:"
echo
- echo 'See https://salsa.debian.org/profile/personal_access_tokens to learn more.'
+ help
exit 1
fi
check_return_code() {
if [ $? -ne 0 ]; then
echo
- echo "Something went wrong!"
+ echo "E: Something went wrong!"
exit 1
fi
}
@@ -76,7 +78,7 @@ SALSA_GROUP=`echo $VCSGIT | sed -e 's#.*://salsa.debian.org/\([^/]\+\)/.*#\1#'`
#echo $VCSGIT
#echo $SALSA_GROUP
-SALSA_GROUP_ID=$(curl -s -f -XGET --header "PRIVATE-TOKEN: $SALSA_TOKEN" "$SALSA_URL/groups/$SALSA_GROUP?with_projects=false" | jq '.id')
+SALSA_GROUP_ID=$(curl -s -f -XGET "$SALSA_URL/groups/$SALSA_GROUP?with_projects=false" | jq '.id')
if [ "$SALSA_GROUP_ID" = "" ] ; then
echo "Failed to find group ID for $SALSA_GROUP"
View it on GitLab: https://salsa.debian.org/med-team/community/helper-scripts/commit/5681ab91c456541078886770c23ab2416099fe63
--
View it on GitLab: https://salsa.debian.org/med-team/community/helper-scripts/commit/5681ab91c456541078886770c23ab2416099fe63
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20190909/5cefc402/attachment-0001.html>
More information about the debian-med-commit
mailing list