-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add ability to create a Change Log fragment file #2635
Comments
This doesn't seem like something we'll likely add to dependabot, but you could certainly write a GitHub Action to do this for you rather than manually doing it each time, we do something similar internally for license information. Here's an example as inspiration: name: Dependabot
on:
push:
branches:
- "dependabot/**"
jobs:
ci-image:
name: Change log fragment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.ref }}
- name: Configure git
run: |
git config --local user.email "$(git log --pretty='%ae' -1)"
git config --local user.name "Dependabot[bot]"
git checkout ${{ github.event.pull_request.head.ref }}
- name: Do things
run: |
# Parse the dependency
commit_message=$(git show -s --format=%B ${{ github.event.pull_request.head.sha }} | head -1)
dependency_name=$(sed -nE 's/Bump (.*) from.*/\1/p' <(echo $commit_message))
# Grab the version and write it to a file.. I don't have any code handy but should be similar to ^
- name: Commit
run: |
git add .changelog/<PR-number>.internal.md
lockfile_changed=$(git status | grep 'Gemfile_next.lock\|vendor/licenses/bundler/')
git commit -m "[dependabot skip] Add fragment"
- name: Push changes back to branch
run: |
git push origin ${{ github.event.pull_request.head.ref }} These are just snippets of things I had laying around, you may want to change/omit parts of that to fit your usecase Handy tip is to include Hope that helps |
@jurre, thanks for your suggestion! I agree that this is probably too niche to be added to Dependabot directly and automating it via a GitHub Action is a great idea. I'll give it a try. |
@jurre what are your thoughts on implementing changelog edits with Github Actions after this change from Github? I've switched to the 'pull_request_target' event because on the 'push' event |
Closing, as recommended above, a GitHub action is the best way to accomplish this. |
At @oasisprotocol, we use the towncrier tool to automatically assemble the Change Log (an example for the Oasis Core 20.11 release) from the Change Log Fragments when preparing a new release.
We have a CI check that ensures each pull request has a corresponding Change Log fragment and now we need to manually amend each Dependabot's pull request with a Change Log fragment file.
It would be great if Dependabot supported creating a file at a given location that would include the same line as in git commit message's subject.
For example, for the following git commit message:
it would create a file at
.changelog/<PR-number>.internal.md
with the following contents:where the file's location and name template would be configurable.
The text was updated successfully, but these errors were encountered: