File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -64,16 +64,22 @@ jobs:
64
64
run : styler::style_pkg()
65
65
shell : Rscript {0}
66
66
67
- - name : Commit and push changes
67
+ - name : Commit and create PR
68
68
run : |
69
69
if FILES_TO_COMMIT=($(git diff-index --name-only ${{ github.sha }} \
70
70
| egrep --ignore-case '\.(R|[qR]md|Rmarkdown|Rnw|Rprofile)$'))
71
71
then
72
72
git config --local user.name "$GITHUB_ACTOR"
73
73
git config --local user.email "[email protected] "
74
+
75
+ BRANCH_NAME="gha-style-${{ github.run_id }}"
76
+ git checkout -b "$BRANCH_NAME"
74
77
git commit ${FILES_TO_COMMIT[*]} -m "Style code (GHA)"
75
- git pull --ff-only
76
- git push origin
78
+ git push origin "$BRANCH_NAME"
79
+
80
+ gh pr create --base master --head "$BRANCH_NAME" --title "Apply styler formatting" --body "This PR applies automated styling fixes."
77
81
else
78
82
echo "No changes to commit."
79
83
fi
84
+ env :
85
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments