name: Qiita Sync on: push: branches: - main workflow_dispatch: jobs: qiita_sync_check: name: Run qiita-sync sync runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.9' - name: Install qiita-sync run: | python -m pip install qiita-sync - name: Run qiita-sync run: | qiita_sync sync . env: QIITA_ACCESS_TOKEN: ${{ secrets.QIITA_ACCESS_TOKEN }} - name: Git run: | find . -name '*.md' -not -path './.*' | xargs git add if ! git diff --staged --exit-code --quiet then git config user.name github-actions git config user.email github-actions@github.com find . -name '*.md' -not -path './.*' | xargs git add git commit -m "updated by qiita-sync" git push fi