File tree Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Run OpenRewrite
2
+
3
+ permissions :
4
+ contents : write
5
+ pull-requests : read
6
+
7
+ on :
8
+ workflow_dispatch :
9
+ inputs :
10
+ pr_number :
11
+ description : ' Pull Request number'
12
+ required : true
13
+ type : number
14
+
15
+ concurrency :
16
+ group : " ${{ github.workflow }}-${{ github.head_ref || github.ref }}-${{ github.event_name }}"
17
+ cancel-in-progress : true
18
+
19
+ jobs :
20
+ rewrite :
21
+ runs-on : ubuntu-latest
22
+
23
+ steps :
24
+ - name : Checkout repo
25
+ uses : actions/checkout@v4
26
+
27
+ - name : Fetch PR branch
28
+ run : |
29
+ gh pr checkout ${{ inputs.pr_number }}
30
+ env :
31
+ GH_TOKEN : ${{secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE}}
32
+
33
+ - name : Set up JDK
34
+ uses : actions/setup-java@v4
35
+ with :
36
+ java-version : 24.0.1
37
+ distribution : ' zulu'
38
+ - name : Setup Gradle
39
+ uses : gradle/actions/setup-gradle@v4
40
+ - name : Generate JBang cache key
41
+ id : cache-key
42
+ shell : bash
43
+ run : |
44
+ echo "cache_key=jbang-$(date +%F)" >> $GITHUB_OUTPUT
45
+ - name : Use cache
46
+ uses : actions/cache@v4
47
+ with :
48
+ lookup-only : true
49
+ path : ~/.jbang
50
+ key : ${{ steps.cache-key.outputs.cache_key }}
51
+ restore-keys :
52
+ jbang-
53
+ - name : Setup JBang
54
+ uses : jbangdev/setup-jbang@main
55
+
56
+ - name : Run rewrite
57
+ run : ./gradlew rewriteRun
58
+
59
+ - name : Commit and push changes
60
+ run : |
61
+ git config user.name "github-actions[bot]"
62
+ git config user.email "github-actions[bot]@users.noreply.github.com"
63
+ if git diff --quiet; then
64
+ echo "No changes to commit."
65
+ else
66
+ git add .
67
+ git commit -m "Fix issues using OpenRewrite"
68
+ git push
69
+ fi
You can’t perform that action at this time.
0 commit comments