You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Changelog action does not play nicely with dependabot #485
I don't know that there is actually a nice solution for this, but its worth flagging up.
Dependabot will only update its own PRs if nobody else has touched them (for example if a later version of a package becomes available). This means that if you use the docs/changelog action (which is marvellous and we should definitely use), then dependabot will see that someone (the pyansys-ci-bot) has edited its PR and refuse to maintain it.
This isn't a dealbreaker most of the time, as it's not especially common for a package to receive multiple releases in a short time, but it is annoying. Additionally it's worth thinking about whether it makes sense to document every separate bump to a package version. Or does it make more sense to add the package bumps in an aggregated form at release time?
I stumbled upon this issue by chance, so sorry for the delay.
The simplest option will be to modify the commit message to include [dependabot skip] as per documentation.
In theory, that commit then won't avoid dependabot rebases. So it should keep mantaining it.
Other option (more complex) is to make dependabot to commit his own commits.
# Update towncrier commits
- name: "Create and commit towncrier fragment"env:
PR_BRANCH: ${{ github.event.pull_request.head.ref }}PR_NUMBER: ${{ github.event.number }}shell: bashrun: | # Changelog fragment file in the following format # For example, 20.added.md fragment="${{ env.PR_NUMBER }}.${{ env.CHANGELOG_SECTION }}.md" # Create changelog fragment with towncrier # Fragment file contains the title of the PR towncrier create -c "${{ env.CLEAN_TITLE }}" $fragment if [[ ${{ github.actor }}" == "dependabot[bot]"" ]]; then echo "It is a dependabot PR" export DEPENDABOT_PR="true" #if later is needed. else echo "It is NOT a dependabot PR" export DEPENDABOT_PR="false" # Configure git username & email git config user.name 'pyansys-ci-bot' git config user.email '[email protected]' fi; # Add towncrier fragment git add . # Check if file was modified modified=`git diff HEAD --name-only` # If the file was modified, commit & push it to the branch if [ ! -z "$modified" ]; then echo "modified: $modified" # Commit and push fragment git commit -m "chore: adding changelog file $fragment" git push fi
Maybe the workflow permissions need to be upgrade to include "contents: write" and "pull-requests: write" permissions, which is probably not nice because the full workflow will have those permissions instead of only this action.
The simplest option will be to modify the commit message to include [dependabot skip] as per documentation. In theory, that commit then won't avoid dependabot rebases. So it should keep mantaining it.
I like this approach - @klmcadams please plan working on this if possible. It is very annoying that dependabot can't autoupdate them.
Pinging @klmcadams for feedback. Also, should the email of pyansysbot be hidden? Just in case. Not sure if it can be a secret.
Reusable actions like this one can't use secrets. They need to be passed as args. I would avoid it. Plus, it is a private email autogenerated by GH.
In that case, we should probably provide that email as a secret (and argument). I do not think it is a good idea to have it exposed. Not sure what are the implications, but it might facilitate impersonate the bot.
Activity
germa89 commentedon Aug 5, 2024
Hi @da1910
I stumbled upon this issue by chance, so sorry for the delay.
The simplest option will be to modify the commit message to include [dependabot skip] as per documentation.
In theory, that commit then won't avoid dependabot rebases. So it should keep mantaining it.
Other option (more complex) is to make dependabot to commit his own commits.
Maybe the workflow permissions need to be upgrade to include "contents: write" and "pull-requests: write" permissions, which is probably not nice because the full workflow will have those permissions instead of only this action.
I think I would go for the simplest option.
References:
germa89 commentedon Aug 5, 2024
Pinging @klmcadams for feedback. Also, should the email of pyansysbot be hidden? Just in case. Not sure if it can be a secret.
RobPasMue commentedon Aug 6, 2024
Reusable actions like this one can't use secrets. They need to be passed as args. I would avoid it. Plus, it is a private email autogenerated by GH.
RobPasMue commentedon Aug 6, 2024
I like this approach - @klmcadams please plan working on this if possible. It is very annoying that dependabot can't autoupdate them.
germa89 commentedon Aug 6, 2024
In that case, we should probably provide that email as a secret (and argument). I do not think it is a good idea to have it exposed. Not sure what are the implications, but it might facilitate impersonate the bot.