Skip to content
Merged
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
7 changes: 6 additions & 1 deletion .github/actions/docker-image-size-tracker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ inputs:
github-token:
description: 'GitHub token for commenting on PRs'
required: true
ci-pat:
description: 'GitHub token for committing to history branch'
required: true
registry:
description: 'Container registry (e.g., ghcr.io)'
required: false
Expand Down Expand Up @@ -258,7 +261,9 @@ runs:
cd /tmp/history-worktree
git add "history/${timestamp}.json"
git commit -m "Add measurement for ${timestamp} (${commit_sha:0:7})"
git config --global url.https://${{ inputs.github-token }}@github.com/.insteadOf https://github.com/
git config --global user.email "ci@rocket.chat"
git config --global user.name "rocketchat-ci[bot]"
git config --global url.https://${{ inputs.ci-pat }}@github.com/.insteadOf https://github.com/
git push origin image-size-history
Comment on lines 263 to 267
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Git config must be set before git commit and push.

The git user configuration (lines 264–265) is set after the git commit (line 263), meaning the commit is attributed to the wrong identity. While the URL config for push (line 266) comes before git push (line 267)—which is correct—the overall ordering is problematic:

  1. Commit is made with the identity from lines 207–208 (github-actions[bot])
  2. Identity is then changed to rocketchat-ci[bot]
  3. Push uses the new identity, creating an inconsistency in git history

Move all git config setup (lines 264–266) to before line 262 (git add), so that both commit and push use the correct identity consistently.

  cd /tmp/history-worktree
+ git config --global user.email "ci@rocket.chat"
+ git config --global user.name "rocketchat-ci[bot]"
+ git config --global url.https://${{ inputs.ci-pat }}@github.com/.insteadOf https://github.com/
  git add "history/${timestamp}.json"
  git commit -m "Add measurement for ${timestamp} (${commit_sha:0:7})"
- git config --global user.email "ci@rocket.chat"
- git config --global user.name "rocketchat-ci[bot]"
- git config --global url.https://${{ inputs.ci-pat }}@github.com/.insteadOf https://github.com/
  git push origin image-size-history

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
.github/actions/docker-image-size-tracker/action.yml around lines 263 to 267:
the git user/email and URL config are set after the git commit, causing the
commit to be attributed to the wrong identity; move the three git config lines
(user.email, user.name, and url.insteadOf) to before the git add/commit sequence
(i.e., place them before line 262) so the configured identity is used for the
commit and the URL credential helper is in place prior to push; keep the git
commit and git push lines as-is after the moved config lines.

cd -

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ jobs:
uses: ./.github/actions/docker-image-size-tracker
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
ci-pat: ${{ secrets.CI_PAT }}
registry: ghcr.io
repository: ${{ needs.release-versions.outputs.lowercase-repo }}
tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
Expand Down
Loading