Collect #17
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: Collect | |
# auto collection | |
on: | |
workflow_dispatch: | |
inputs: | |
date: | |
description: 'crawler date time' | |
required: true | |
token: | |
description: 'select token' | |
required: true | |
schedule: | |
- cron: '0 15 * * *' | |
jobs: | |
collect-github: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
name: Set up Python | |
with: | |
python-version: '3.10' | |
- name: Prepare | |
run: pip3 install -r requirement.txt | |
- name: Crawler | |
run: python3 main.py ${{ secrets.CUSTOMS_GITHUB_TOKEN }} ${{ inputs.date }} ${{ inputs.token }} | |
- name: Upload Repos | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Github Action" | |
git remote set-url origin https://${{ github.actor }}:$(echo "${{ secrets.CUSTOMS_GITHUB_TOKEN }}" | cut -d ',' -f 1)@github.com/${{ github.repository }} | |
git pull --rebase | |
git add . | |
git commit -m "Auto Update `date --rfc-3339=seconds`" | |
git push -f | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: github | |
path: github-*.json |