Fixing git push
This commit is contained in:
16
action.yml
16
action.yml
@@ -11,6 +11,9 @@ inputs:
|
|||||||
- "Major - Incompatible API changes"
|
- "Major - Incompatible API changes"
|
||||||
- "Minor - Adding functionality in a backward compatible manner"
|
- "Minor - Adding functionality in a backward compatible manner"
|
||||||
- "Patch - Backward compatible bug fixes"
|
- "Patch - Backward compatible bug fixes"
|
||||||
|
token:
|
||||||
|
description: 'A Gitea PAT'
|
||||||
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
@@ -49,11 +52,16 @@ runs:
|
|||||||
git config user.email "release@example.com"
|
git config user.email "release@example.com"
|
||||||
git config user.name "Release"
|
git config user.name "Release"
|
||||||
|
|
||||||
original_url="$(git remote get-url origin)"
|
log_info "Overriding git repository auth with PAT"
|
||||||
repo_url="${original_url#https://}" # Remove HTTPS
|
|
||||||
new_url="https://x-access-token:${{ secrets.CI_GIT_WRITE_TOKEN }}@$repo_url"
|
|
||||||
git remote set-url origin "$new_url"
|
|
||||||
|
|
||||||
|
repo_url="$(git remote get-url origin)"
|
||||||
|
repo_url="${repo_url#https://}" # Remove HTTPS
|
||||||
|
GIT_NEW_URL="https://${GITHUB_REPOSITORY_OWNER}:${{ inputs.token }}@${repo_url}.git"
|
||||||
|
|
||||||
|
git remote set-url origin "$GIT_NEW_URL"
|
||||||
|
git config --local --unset http.https://${GITHUB_SERVER_URL#https://}/.extraheader
|
||||||
|
|
||||||
|
log_info "Pushing new tag"
|
||||||
git fetch
|
git fetch
|
||||||
git tag -a "v${NEW_VERSION}" -m "Release version ${NEW_VERSION}"
|
git tag -a "v${NEW_VERSION}" -m "Release version ${NEW_VERSION}"
|
||||||
git push origin "v${NEW_VERSION}"
|
git push origin "v${NEW_VERSION}"
|
||||||
|
|||||||
Reference in New Issue
Block a user