-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation about setting up towncrier on pipelines #443
Comments
Towncrier uses GitHub Actions ... so I think that can be used as an example. I don't much experience with GitLab / Azure Pipelines / Circle CI. But towncrier is quite simple. |
My main concern with towncrier in gitlab's pipeline is about the process of building the changelog in the pipeline.
I think it's quite similar to github, fetching data from the default branch and comparing changes. But when trying to create and pushing the changelog it breaks because can't push to the main branch. The job is like this
Don't know if it's a configuration issue or gitlab can't handle pushing elements from the pipeline. How is the build command handled with github actions? |
This look like generic git usage in GitLab and not towncrier. the This doesn't look like a towncrier issue. What I do, is run |
so the usual way to publish changelogs is manually? |
Thanks for the info. I got it :) Is not that towncrier should only be use for manualy processes. But from what you are describing, the issue is with configuring GitLab to push a change back to the repo. This is a git configuration and not a towncrier configuration. The same issue you would have if you want to make an automatic change with towncrier, or with black and then try to push the changes back. I am not saying that we should not have that type of information. As you mentioned, the automated changelog/release-notes files using towncrier works... it fails when trying to use git to push the file back. |
@qequ publish-news:
image:
name: python:3.11-alpine
before_script:
- apk add -U git
- python -m pip install towncrier
stage: package
needs: []
variables:
COMMIT_MESSAGE: Update `CHANGELOG.md` for next version
COMMIT_FILES: CHANGELOG.md changelog.d/
script:
- towncrier build --version "$CHART_VERSION" --yes
- |-
CHANGES=$(git status --porcelain | wc -l)
if [ $CHANGES -gt 0 ];then
echo "committing"
git config --global user.name ${GITLAB_USER_NAME}
git config --global user.email "${GITLAB_USER_EMAIL}"
git add ${COMMIT_FILES}
git commit -m "${COMMIT_MESSAGE}"
git push -o ci.skip https://gitlab-ci-token:${TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH} HEAD:${CI_COMMIT_REF_NAME}
else
echo "no change, nothing to commit"
fi |
CC: @dgutson @Franco0700 |
The main documentation of towncrier lacks information about setting up towncrier to work on github/gitlab pipelines. It would be great to add configuration steps for that
The text was updated successfully, but these errors were encountered: