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
Copy file name to clipboardExpand all lines: docs/dev/extend-awards.md
+15-1Lines changed: 15 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,20 @@ The primary job consists of several steps:
21
21
- a script (see below) is executed, which appends lines to [awards.csv](awards.csv) if needed
22
22
-[create-pull-request](https://github.com/peter-evans/create-pull-request) looks for modified files and creates (or updates) a PR
23
23
24
+
### Branch Existence Check
25
+
26
+
The workflow includes functionality to check if the branch `extend-awards/patch` already exists. This ensures that if a PR is already open for extending `awards.csv`, the workflow will add a commit to the existing branch instead of creating a new PR. The steps are as follows:
27
+
28
+
1.**Check if the branch exists**:
29
+
- The workflow fetches the branch `extend-awards/patch` from the remote repository.
30
+
- If the branch exists, an environment variable `exists=true` is set; otherwise, `exists=false`.
31
+
32
+
2.**Handle existing branch**:
33
+
- If the branch exists (`exists=true`), the workflow checks out the branch, configures the Github bot user, and commits the changes directly to the branch.
34
+
- If the branch does not exist (`exists=false`), the workflow creates a new branch and opens a new PR using the `create-pull-request` action.
35
+
36
+
This ensures that changes are consolidated into a single PR when possible.
37
+
24
38
## Script
25
39
26
40
The script is [extend-awards.py](extend-awards.py).
@@ -41,7 +55,7 @@ Finally, it appends zero, one, or two lines to the awards.csv file.
41
55
42
56
## Diagnostics
43
57
44
-
In the GitHub web interface under 'Actions' each invokation of the action can be viewed, including environment and [output and errors](https://en.wikipedia.org/wiki/Standard_streams) of the script. First, the specific invokation is selected, then the job 'if_merged', then the step 'Run python extend-awards.py'. The environment is found by expanding the inner 'Run python extended-awards.py' on the first line.
58
+
In the GitHub web interface under 'Actions' each invocation of the action can be viewed, including environment and [output and errors](https://en.wikipedia.org/wiki/Standard_streams) of the script. First, the specific invocation is selected, then the job 'if_merged', then the step 'Run python extend-awards.py'. The environment is found by expanding the inner 'Run python extended-awards.py' on the first line.
45
59
46
60
The normal output includes details about the issue number found, the amount calculation, or the reason for not appending lines.
0 commit comments