fonsdant commented on code in PR #17204:
URL: https://github.com/apache/kafka/pull/17204#discussion_r1769544347


##########
.github/workflows/ci-complete.yml:
##########
@@ -118,3 +118,16 @@ jobs:
           description: 'The build scan was successfully published'
           context: 'Gradle Build Scan / Java ${{ matrix.java }}'
           state: 'success'
+
+  update-cached-tag:
+    # Only run this job if the previous workflow run was successful
+    if: github.event.workflow_run.conclusion == 'success'
+    runs-on: ubuntu-latest
+    steps:
+      - name: Update trunk-cached branch with trunk
+        run: |
+          git switch trunk-cached || git switch -c trunk-cached

Review Comment:
   As we are doing a `reset` here, it is not needed to do `fetch`. Even if we 
do `fetch`, the fetched trunk-cached branch will be reset to `github.sha` as 
well as the unfetched trunk-cached branch. So the fetched trunk-cached does not 
change the result.
   
   I have done two tests for this. You can check them 
[here](https://github.com/fonsdant/github-actions/actions/runs/10968527602/job/30459981606#step:3:11)
 and 
[here](https://github.com/fonsdant/github-actions/actions/runs/10968538249/job/30460008394#step:3:11).
   
   This is the `git log` result:
   
   ```
   $ git log --oneline 
   e8da285 (HEAD -> trunk, origin/trunk-cached, origin/trunk) update ble.txt
   d9c105e minimal impl
   425d23e replace sha with origin trunk branch
   ...
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to