Skip to content

Commit 66672ae

Browse files
authored
Merge pull request #2 from mageddo-projects/version-upgrade
Implement new way to authenticate
2 parents 27711e8 + 7f0f61d commit 66672ae

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
## Using IT
12
Setup token
23

34
```bash
@@ -25,3 +26,11 @@ REPO_TOKEN=8094deb9fe1d7d15598a8e7b876e151810630635
2526
```bash
2627
./github-cli.sh release mageddo-projects github-cli v1.0 master "some description" tmp.zip
2728
```
29+
30+
## Contributing
31+
32+
### Generating a release
33+
34+
```
35+
/github-cli.sh release mageddo-projects github-cli v1.5 master "some description" github-cli.sh
36+
```

github-cli.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ create_release(){
1919
"prerelease": true
2020
}' | sed -r 's/[\]{2}/\\/g')
2121
(curl -s -X POST -w '%{stderr}%{http_code}\n%{stdout}\n' \
22+
-H "Authorization: token ${REPO_TOKEN}" \
2223
"https://api.github.com/repos/${USERNAME}/${REPOSITORY}/releases?access_token=$REPO_TOKEN" \
2324
--data "$PAYLOAD" |\
2425
tee -a /dev/stderr | jq -r '.id') 2> /tmp/stderr 1> /tmp/stdout
@@ -35,7 +36,8 @@ create_release(){
3536
upload_file(){
3637
local OUT=$(curl --data-binary "@$SOURCE_FILE" -w "\n%{http_code}\n" \
3738
-s -X POST -H 'Content-Type: application/octet-stream' \
38-
"https://uploads.github.com/repos/${USERNAME}/${REPOSITORY}/releases/$RELEASE_ID/assets?name=$TARGET_FILE&access_token=$REPO_TOKEN"
39+
-H "Authorization: token ${REPO_TOKEN}" \
40+
"https://uploads.github.com/repos/${USERNAME}/${REPOSITORY}/releases/$RELEASE_ID/assets?name=$TARGET_FILE"
3941
)
4042

4143
if test "$(echo "$OUT" | tail -n 1)" -ne "201"; then
@@ -63,8 +65,8 @@ validate_repo_token(){
6365
}
6466

6567
create_tag(){
66-
git config user.email "builds@travis-ci.com"
67-
git config user.name "Travis CI"
68+
git config user.email "githubcli@github.com"
69+
git config user.name "Github CLI"
6870

6971
git commit -a -m "Releasing ${APP_VERSION}" || true
7072
git tag ${APP_VERSION}

0 commit comments

Comments
 (0)