diff --git a/.github/workflows/scc.yml b/.github/workflows/scc.yml index 5784baa..2606ec1 100644 --- a/.github/workflows/scc.yml +++ b/.github/workflows/scc.yml @@ -21,9 +21,21 @@ jobs: uses: iryanbell/scc-docker-action@v1.0.2 with: args: ${{ env.workspace }} -i html,rust,python,c,sml,asm,ruby > table.html - - name: Save Results - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.ref == 'refs/heads/main' }} + - name: Commit files + id: commit + run: | + git config --local user.email "action@github.com" + git config --local user.name "github-actions" + git add --all + if [-z "$(git status --porcelain)"]; then + echo "::set-output name=push::false" + else + git commit -m "Add changes" -a + echo "::set-output name=push::true" + fi + shell: bash + - name: Push changes + if: steps.commit.outputs.push == 'true' + uses: ad-m/github-push-action@master with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./statistics + github_token: ${{ secrets.GITHUB_TOKEN }}