Fixed fast-forward

This commit is contained in:
2024-12-27 11:58:16 +01:00
parent d90aa65d21
commit 8cd4e1c57d

View File

@@ -52,20 +52,21 @@ runs:
log_info "New version: ${NEW_VERSION}" log_info "New version: ${NEW_VERSION}"
echo NEW_VERSION=${NEW_VERSION} >> $GITEA_ENV echo NEW_VERSION=${NEW_VERSION} >> $GITEA_ENV
- name: Pushing new version - name: Setting up release git account
run: | run: |
git config user.email "release@example.com" git config user.email "release@example.com"
git config user.name "Release" git config user.name "Release"
log_info "Overriding git repository auth with PAT" log_info "Overriding git repository auth with PAT"
repo_url="$(git remote get-url origin)" repo_url="$(git remote get-url origin)"
repo_url="${repo_url#https://}" # Remove HTTPS repo_url="${repo_url#https://}" # Remove HTTPS
GIT_NEW_URL="https://${GITHUB_REPOSITORY_OWNER}:${{ inputs.token }}@${repo_url}.git" GIT_NEW_URL="https://${GITHUB_REPOSITORY_OWNER}:${{ inputs.token }}@${repo_url}.git"
git remote set-url origin "$GIT_NEW_URL" git remote set-url origin "$GIT_NEW_URL"
git config --local --unset http.https://${GITHUB_SERVER_URL#https://}/.extraheader git config --local --unset http.https://${GITHUB_SERVER_URL#https://}/.extraheader
- name: Pushing new version
run: |
log_info "Pushing new tag" 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}"
@@ -74,5 +75,5 @@ runs:
run: | run: |
log_info "Fast-forwarding master to dev" log_info "Fast-forwarding master to dev"
git checkout master git checkout master
git merge --ff-only origin/dev git merge --ff-only dev
git push --force-with-lease git push --force-with-lease