Skip to content

Commit

Permalink
chore: get owner and repo from cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
luigibarbato committed Sep 27, 2023
1 parent 0e0918f commit cb8742e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
- name: Release
run: |
./scripts/release.sh $BOT_GITHUB_TOKEN
./scripts/release.sh unconditionalday source $BOT_GITHUB_TOKEN
env:
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
13 changes: 6 additions & 7 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ calver=$(date +%Y-%m-%d)
git tag -a "$calver" -m "Version $calver"
git push origin "$calver"

OWNER="unconditionalday"
REPO="source-test"

TOKEN=$1
OWNER=$1
REPO=$2
TOKEN=$3

response=$(curl -X POST "https://api.github.com/repos/$OWNER/$REPO/releases" \
-H "Authorization: token $TOKEN" \
Expand All @@ -21,9 +20,9 @@ response=$(curl -X POST "https://api.github.com/repos/$OWNER/$REPO/releases" \
release_id=$(echo "$response" | jq -r '.id')

if [ "$release_id" != "null" ]; then
echo "Release $calver creata con successo su GitHub (ID: $release_id)"
echo "Release $calver created successfully on GitHub (ID: $release_id)"
else
echo "Errore nella creazione della release su GitHub."
echo "Error creating the release on GitHub."
echo "$response"
exit 1
fi
Expand All @@ -36,4 +35,4 @@ curl -X POST -H "Authorization: token $TOKEN" -H "Content-Type: application/json
--data-binary @"$FILE_PATH" \
"$upload_url?name=source.json"

echo "Allegato aggiunto con successo alla release."
echo "Attachment added successfully to the release."

0 comments on commit cb8742e

Please sign in to comment.