GitStats Report #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitStats Report | |
on: | |
workflow_dispatch: | |
inputs: | |
name: | |
description: 'The repo path to clone' | |
required: false | |
#default: 'https://github.com/jenkinsci/jenkins.git' | |
default: 'https://github.com/yansheng836/awesome-software' | |
type: string | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gnuplot | |
- name: Generate GitStats Report and deploy | |
run: | | |
pipx install gitstats | |
git clone ${{ inputs.name }} | |
repo_name=$(basename -s .git "${{ inputs.name }}") | |
echo "REPO_NAME=$repo_name" >> $GITHUB_ENV | |
#gitstats ./$repo_name gitstats-report | |
cd ./$repo_name | |
gitstats ./ ./gitstats-report | |
git config --global user.email "[email protected]" | |
git config --global user.name "yansheng836" | |
git add . | |
git commit -m "deploy: gitstats-report" | |
#git push origin main | |
# Push changes to the repository using GITHUB_TOKEN | |
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} HEAD:main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
#- name: Deploy to GitHub Pages | |
# if: ${{ github.event_name == 'workflow_dispatch' }} | |
# uses: peaceiris/actions-gh-pages@v4 | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# publish_branch: main # default: gh-pages,这个好像会全部清掉,如果是主分支会有问题 | |
# #publish_dir: gitstats-report # default: public | |
# publish_dir: ./ # default: public | |
#destination_dir: examples/${{ env.REPO_NAME }} # gh-pages/examples/jenkins | |
#destination_dir: gitstats-report |