Skip to content

Commit 298ed89

Browse files
authored
Use setup-jbang action (instead of custom call of .sh script) (#13208)
* Use setup-jbang action (instead of custom call of .sh script) * Output PR URL * Add "run-main" * Fix run-main call * Output commit id * Remove quotes
1 parent 14b5611 commit 298ed89

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,7 @@ jobs:
283283
submodules: 'false'
284284
show-progress: 'false'
285285
- name: Install JBang
286-
run: |
287-
curl -Ls https://sh.jbang.dev | bash -s - app setup
288-
echo "$HOME/.jbang/bin" >> $GITHUB_PATH
286+
uses: jbangdev/setup-jbang@main
289287
- run: jbang build .jbang/CheckoutPR.java
290288
- run: jbang build .jbang/CloneJabRef.java
291289
- run: jbang build .jbang/JabKitLauncher.java

.jbang/CheckoutPR.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public static void main(String[] args) throws Exception {
7575
pr = repo.getPullRequest(prNumber);
7676
}
7777

78+
System.out.println("Determined PR URL is " + pr.getUrl());
79+
7880
if (pr.isMerged()) {
7981
System.out.println("Pull request is already merged - checking out main branch...");
8082
checkoutUpstreamMain();
@@ -144,7 +146,8 @@ public static void main(String[] args) throws Exception {
144146
.call();
145147
}
146148

147-
System.out.println("Checked out PR #" + pr.getNumber() + " (" + pr.getTitle() + ") to branch '" + localBranchName + "'.");
149+
System.out.println("Checked out PR #" + pr.getNumber() + " (" + pr.getTitle() + ") to branch " + localBranchName + ".");
150+
System.out.println("Checked out commit " + pr.getHead().getSha() + ".");
148151
}
149152

150153
private static void checkoutUpstreamMain() throws Exception {

justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ run-jabkit *FLAGS:
4646
run-jabsrv *FLAGS:
4747
.\gg.cmd gradle :jabsrv-cli:run --args="{{FLAGS}}"
4848

49+
run-main:
50+
just run main
51+
4952
run-pr pr-id:
5053
just checkout-pr {{pr-id}}
5154
just run-gui

0 commit comments

Comments
 (0)