Commit cafdea9
Improve Workflow Robustness and Feedback (#256)
* maintenance: Improve workflow robustness and feedback
This commit introduces two main improvements to the GitHub Actions workflows:
1. **Emoji Reaction for Issue Comments:**
The `get-pr-info` reusable action now automatically adds an "eyes" (👀) emoji reaction to any issue comment that triggers a workflow. This provides immediate visual feedback to the user that their command has been acknowledged. This logic is centralized in the reusable action, ensuring it is applied consistently across all workflows that use it.
2. **Robust Concurrent Push Handling:**
The `handle-fix-commit` reusable action has been enhanced to gracefully handle race conditions where multiple workflows attempt to push to the same branch simultaneously. The third-party `EndBug/add-and-commit` action has been replaced with a custom script that implements a "rebase and retry" mechanism. If a push fails, the script will automatically fetch the latest changes, rebase the local commit, and retry the push, attempting this up to five times before failing. This prevents silent failures and makes the "fix" workflows more reliable.
* maintenance: Address feedback from code review
This commit incorporates feedback from the code review:
- Adds a conditional check to the emoji reaction step to ensure it only runs on `issue_comment` events.
- Improves the `handle-fix-commit` action by:
- Using local instead of global git config.
- Properly authenticating git push with the provided token.
- Refining the rebase-and-retry logic for better robustness.
- Ensuring the reported commit SHA is accurate after a potential rebase.
* maintenance: Address feedback from code review
This commit incorporates feedback from the code review:
- Adds a conditional check to the emoji reaction step to ensure it only runs on `issue_comment` events.
- Improves the `handle-fix-commit` action by:
- Using local instead of global git config.
- Properly authenticating git push with the provided token.
- Refining the rebase-and-retry logic for better robustness.
- Ensuring the reported commit SHA is accurate after a potential rebase.
* fix: Correct remote URL for forks in handle-fix-commit
This commit addresses a critical bug in the `handle-fix-commit` action where the `git remote` was always being set to the base repository.
The action now correctly uses the `pr-info-repo` input to set the remote URL. This ensures that for pull requests from forks, the `git fetch`, `git rebase`, and `git push` commands all target the contributor's forked repository, allowing the rebase-and-retry logic to function as intended.
* fix: Improve security and robustness of handle-fix-commit
This commit addresses feedback from the latest code review, making the `handle-fix-commit` action more secure and robust:
- **Secure Token Handling:** Replaces the `git remote set-url` method with a credential helper to avoid exposing the token in logs.
- **Safer Staging:** Changes `git add .` to `git add -u` to prevent accidentally staging untracked files.
- **Configurable Retries:** Adds a `retry-attempts` input to the action, making the retry logic transparent and configurable, with a default of 6.
* Delete credentials file on exit
Avoids potential credential leakage, per #256 (comment)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Chris Green <greenc@fnal.gov>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent 590a4d9 commit cafdea9
File tree
2 files changed
+55
-10
lines changed- .github/actions
- get-pr-info
- handle-fix-commit
2 files changed
+55
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
64 | 97 | | |
65 | 98 | | |
66 | | - | |
| 99 | + | |
67 | 100 | | |
68 | 101 | | |
69 | 102 | | |
70 | | - | |
| 103 | + | |
71 | 104 | | |
72 | 105 | | |
73 | 106 | | |
| |||
0 commit comments