@@ -96,22 +96,43 @@ jobs:
9696
9797 # Generate SVG equations:
9898 - name : ' Generate SVG equations'
99+ id : svg-equations
99100 run : |
100101 make markdown-svg-equations-files FILES="${{ steps.changed.outputs.files }}"
101- git add -A && git commit -m "Add SVG equations"
102+
103+ if [[ -z "$(git status --porcelain)" ]]; then
104+ # If no files were changed, exit with a success status code:
105+ echo "::set-output name=changed::false"
106+ exit 0
107+ else
108+ # Otherwise, add changed files to the staging area and commit:
109+ git add -A && git commit -m "Add SVG equations"
110+ echo "::set-output name=changed::true"
111+ fi
102112 timeout-minutes : 15
103113
104114 # Update Markdown equation elements:
105115 - name : ' Update equation elements'
116+ id : equation-elements
106117 run : |
107118 make markdown-img-equations-files FILES="${{ steps.changed.outputs.files }}"
108119 make markdown-img-equations-src-urls-files FILES="${{ steps.changed.outputs.files }}"
109- git add -A && git commit -m "Update Markdown equation elements"
120+
121+ if [[ -z "$(git status --porcelain)" ]]; then
122+ # If no files were changed, exit with a success status code:
123+ echo "::set-output name=changed::false"
124+ exit 0
125+ else
126+ # Otherwise, add changed files to the staging area and commit:
127+ git add -A && git commit -m "Update Markdown equation elements"
128+ echo "::set-output name=changed::true"
129+ fi
110130 timeout-minutes : 15
111131
112132 # Create a pull request with the updated equations:
113133 - name : ' Create pull request'
114134 id : cpr
135+ if : steps.svg-equations.outputs.changed == 'true' || steps.equation-elements.outputs.changed == 'true'
115136 uses : peter-evans/create-pull-request@v3
116137 with :
117138 title : ' Update Markdown equation elements'
@@ -132,6 +153,7 @@ jobs:
132153
133154 # Create Markdown summary of the pull request:
134155 - name : ' Create summary'
156+ if : steps.svg-equations.outputs.changed == 'true' || steps.equation-elements.outputs.changed == 'true'
135157 run : |
136158 echo "# :tada: Pull Request created! :tada:" >> $GITHUB_STEP_SUMMARY
137159 echo "" >> $GITHUB_STEP_SUMMARY
0 commit comments