File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change 21
21
- name : " Checkout"
22
22
uses : actions/checkout@main
23
23
24
+ # This makes it easier to push changes back to the PR
25
+ - name : " Checkout w/ gh"
26
+ run : gh pr checkout ${{ github.event.pull_request.number}}
27
+ env :
28
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29
+
24
30
- name : Setup asdf
25
31
uses : asdf-vm/actions/setup@v2
26
32
@@ -40,15 +46,21 @@ jobs:
40
46
env :
41
47
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
42
48
43
- - name : " Confirm "
49
+ - name : " Commit if Necessary "
44
50
run : |
45
51
if [[ "$(basename "$(git rev-parse --show-toplevel)")" != *'terraform-aws-template'* ]]; then
46
52
echo "Setting core.fileMode to false to avoid false positives in documentation check."
47
53
git config core.fileMode false
48
54
if [[ -n $(git status --porcelain) ]]; then
49
- echo "Documentation is not up to date. Run ./scripts/document.sh"
50
- git status -v
51
- git diff
52
- exit 1
55
+ echo "Documentation is not up to date. Comitting updates"
56
+
57
+ git add README.md
58
+ git config user.name "${GITHUB_USERNAME}"
59
+ git config user.email "${GITHUB_USERNAME}@users.noreply.github.com"
60
+ git commit -m "Running document script"
61
+ git push
53
62
fi
54
63
fi
64
+ env :
65
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66
+ GITHUB_USERNAME : ${{ github.actor }}
You can’t perform that action at this time.
0 commit comments