Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ jobs:
RENOVATE_BRANCH_PREFIX: renovate-github/
RENOVATE_ENABLED: ${{ vars.RENOVATE_ENABLED || true }}
RENOVATE_ENABLED_MANAGERS: '["pep621", "github-actions", "gitlabci", "regex", "pre-commit"]'
RENOVATE_GIT_AUTHOR: ${{ vars.RENOVATE_GIT_AUTHOR || 'Renovate GitHub Bot <github@renovatebot.com>' }}
RENOVATE_OPTIMIZE_FOR_DISABLED: "true"
RENOVATE_PLATFORM: github
RENOVATE_REPOSITORIES: '["${{ github.repository }}"]'
RENOVATE_REPOSITORY_CACHE: enabled
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
image: ghcr.io/renovatebot/renovate:37.269.3-full@sha256:9445e3bc58cfd9885de7c04d8b96640628a320c6022fb5928c04103196a0d09f
options: "--user root"
runs-on: ubuntu-22.04
Expand All @@ -27,8 +25,14 @@ jobs:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- env:
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN || steps.generate-token.outputs.token }}
RENOVATE_TOKEN: ${{ steps.generate-token.outputs.token || secrets.RENOVATE_TOKEN }}
RENOVATE_GIT_AUTHOR: ${{ vars.RENOVATE_GIT_AUTHOR }}
run: |
if [ -n "${{ steps.generate-token.outputs.token }}" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have several concern about the logic here:

  1. According to the doc, username is also optional, autodetected if not supplied, have you ever tried whether that works?
  2. If the template users are using PAT and no variable RNOVATE_GIT_AUTHOR is provided, we should use the default value, but seems the default value is removed.
  3. If the template users provide a specific value to variable RENOVATE_GIT_AUTHOR, we should respect it whenever GitHub App is used.

Copy link
Contributor Author

@msclock msclock Mar 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to further verify feasibility on it.

Copy link
Contributor Author

@msclock msclock Apr 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have verified the following scenes:

  • only bot token(not username): it detects username and sets the correct bot account.
  • bot token and git author: it still resolves to use bot account.
  • bot token and not git author(use yaml default author explictly): use bot account again.

I don't known how it creates a ghost user now and feel confused.🤣

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any corresponding job logs or created pull requests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from actions #3, commit renovate job run manually log says it use configured git author. But the created pr #1 #2 both are authored by my configured bot account.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding, they are two different things. The author of the pull request author is only determined by the token used when creating the pull request. So it will either be a personal account when using PAT or bot account when using token generated by GitHub App. The renovate configuration only affects the git author of the commits, as you can see in the commits tab [1][2].

[1] https://github.com/msclock/smooth7zip/pull/1/commits
[2] https://github.com/msclock/smooth7zip/pull/2/commits

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huxuan Ah! I missed that flaws after several weeks.🤣

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems we have consumed too much energy on this, if necessary, we can have a online discussion about this.

Copy link
Contributor Author

@msclock msclock Apr 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huxuan it's all right. just need to do trade-offs. I have made another pr #470 and switch to just warn users. Feel free to alter it if you need any improvement.

unset RENOVATE_GIT_AUTHOR
export RENOVATE_USERNAME="${{ steps.generate-token.outputs.app-slug }}[bot]"
fi

if [ -z "$RENOVATE_TOKEN" ]; then
echo "RENOVATE_TOKEN is not properly configured, skipping ..."
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ jobs:
[%- else %]
RENOVATE_ENABLED_MANAGERS: '["pep621", "github-actions", "regex", "pre-commit"]'
[%- endif %]
RENOVATE_GIT_AUTHOR: {{ '${{ vars.RENOVATE_GIT_AUTHOR || \'Renovate GitHub Bot <github@renovatebot.com>\' }}' }}
RENOVATE_OPTIMIZE_FOR_DISABLED: "true"
RENOVATE_PLATFORM: github
RENOVATE_REPOSITORIES: '["{{ '${{ github.repository }}' }}"]'
RENOVATE_REPOSITORY_CACHE: enabled
RENOVATE_TOKEN: {{ '${{ secrets.RENOVATE_TOKEN }}' }}
image: ghcr.io/renovatebot/renovate:37.269.3-full@sha256:9445e3bc58cfd9885de7c04d8b96640628a320c6022fb5928c04103196a0d09f
options: "--user root"
runs-on: ubuntu-22.04
Expand All @@ -31,8 +29,14 @@ jobs:
app-id: {{ '${{ vars.BOT_APP_ID }}' }}
private-key: {{ '${{ secrets.BOT_PRIVATE_KEY }}' }}
- env:
RENOVATE_TOKEN: {{ '${{ secrets.RENOVATE_TOKEN || steps.generate-token.outputs.token }}' }}
RENOVATE_TOKEN: {{ '${{ steps.generate-token.outputs.token || secrets.RENOVATE_TOKEN }}' }}
RENOVATE_GIT_AUTHOR: {{ '${{ vars.RENOVATE_GIT_AUTHOR }}' }}
run: |
if [ -n "{{ '${{ steps.generate-token.outputs.token }}' }}" ]; then
unset RENOVATE_GIT_AUTHOR
export RENOVATE_USERNAME="{{ '${{ steps.generate-token.outputs.app-slug }}' }}[bot]"
fi

if [ -z "$RENOVATE_TOKEN" ]; then
echo "RENOVATE_TOKEN is not properly configured, skipping ..."
else
Expand Down