From a6e93584faea5cf70e139deabcec7a726d5d25fc Mon Sep 17 00:00:00 2001 From: francescobianco Date: Sun, 20 Oct 2024 23:26:28 +0200 Subject: [PATCH] Release --- bin/devops-tracking | 12 +++++++++--- src/main.sh | 10 ++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/bin/devops-tracking b/bin/devops-tracking index b5e6a55..7a51acf 100755 --- a/bin/devops-tracking +++ b/bin/devops-tracking @@ -3,7 +3,7 @@ # @package: devops-tracking # @build_type: bin # @build_with: Mush 0.2.0 (2024-03-21) -# @build_date: 2024-10-20T20:34:41Z +# @build_date: 2024-10-20T21:26:28Z set -e use() { return 0; } extern() { return 0; } @@ -55,6 +55,9 @@ ACCESS_TOKEN=$(curl -s --request POST \ --data "grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=$jwt" | jq -r '.access_token') datetime=$(date +'%F %T') +monthnum=$(date +"%YM%m") +weeknum=$(date +"%YW%V") +daynum=$(date +"%YD%j") if [ -n "${GITHUB_REPOSITORY}" ]; then repository="https://github.com/${GITHUB_REPOSITORY}" @@ -62,17 +65,20 @@ else repository=$(git config --get remote.origin.url && true) fi +release=1 +error=0 + # Prepara i dati da inserire DATA='{ "range": "'$RANGE'", "majorDimension": "ROWS", "values": [ - ["'$datetime'", "'$repository'", "'$event'"] + ["'$datetime'", "'$monthnum'", "'$weeknum'", "'$daynum'", "'$repository'", "'$release'", "'$error'"] ] }' # Invia la richiesta all'API di Google Sheets per aggiungere una riga -curl -X POST \ +curl -s -X POST \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d "$DATA" \ diff --git a/src/main.sh b/src/main.sh index f638aa0..3ac859f 100644 --- a/src/main.sh +++ b/src/main.sh @@ -41,6 +41,9 @@ ACCESS_TOKEN=$(curl -s --request POST \ --data "grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=$jwt" | jq -r '.access_token') datetime=$(date +'%F %T') +monthnum=$(date +"%YM%m") +weeknum=$(date +"%YW%V") +daynum=$(date +"%YD%j") if [ -n "${GITHUB_REPOSITORY}" ]; then repository="https://github.com/${GITHUB_REPOSITORY}" @@ -48,17 +51,20 @@ else repository=$(git config --get remote.origin.url && true) fi +release=1 +error=0 + # Prepara i dati da inserire DATA='{ "range": "'$RANGE'", "majorDimension": "ROWS", "values": [ - ["'$datetime'", "'$repository'", "'$event'"] + ["'$datetime'", "'$monthnum'", "'$weeknum'", "'$daynum'", "'$repository'", "'$release'", "'$error'"] ] }' # Invia la richiesta all'API di Google Sheets per aggiungere una riga -curl -X POST \ +curl -s -X POST \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d "$DATA" \