-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Protoype automatic changelogs for dependabot PRs #13998
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Write changelog for dependabot PR | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
|
||
jobs: | ||
add-changelog: | ||
runs-on: 'ubuntu-latest' | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To the reviewer: please double check that
I think this is correct, but I am not an expert with git's plumbing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks right to me. (I think, by default, it checks out the SHA of a merge between the PR branch and the target branch?) |
||
- name: Write, commit and push changelog | ||
run: | | ||
echo "${{ github.event.pull_request.title }}." > "changelog.d/${{ github.event.pull_request.number }}".docker | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this not be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rationale: altering the lockfile changes the contents of the Docker images and Debian packages. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It also changes the dependencies for all poetry based installations. Personally I'd read something in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's fair. I'll commit directly to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I'll be a good boy and raise a PR so that we have a proper changelog. |
||
git add changelog.d | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git config user.name "GitHub Actions" | ||
git commit -m "Changelog" | ||
git push | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if dependabot will have the ability to push to its own PR branch. According to the docs its PRs are run as if they came from forks, for security's sake. I think it should be able to push another commit to its own pseudo-fork, but I'm not totally sure. Suggest we try this out and see if it works? |
||
shell: bash |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Prototype a workflow to automatically add changelogs to dependabot PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be the done thing, according to e.g. here