parent
f4422c3f58
commit
0987aa302d
3 changed files with 52 additions and 58 deletions
@ -1,43 +1,43 @@ |
||||
name: Run Python Script on Main Branch |
||||
|
||||
on: |
||||
push: |
||||
branches: |
||||
- main |
||||
workflow_dispatch: |
||||
|
||||
jobs: |
||||
run_script: |
||||
runs-on: ubuntu-latest |
||||
|
||||
steps: |
||||
- name: Checkout repository |
||||
uses: actions/checkout@v2 |
||||
|
||||
- name: Set up Python |
||||
uses: actions/setup-python@v2 |
||||
with: |
||||
python-version: 3.8 |
||||
|
||||
- name: Install dependencies |
||||
run: | |
||||
python -m pip install --upgrade pip |
||||
# Add any other dependencies your script requires here |
||||
|
||||
- name: Run Python script |
||||
run: python convert.py |
||||
|
||||
- name: Configure Git |
||||
run: | |
||||
git config --local user.email "luoyukongchan@outlook.com" |
||||
git config --local user.name "Yi Liu" |
||||
env: |
||||
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }} |
||||
|
||||
- name: Commit and push JSON file |
||||
run: | |
||||
if git status --porcelain | grep -q "urls.json"; then |
||||
git add urls.json |
||||
git commit -m "Update urls.json" |
||||
git push |
||||
fi |
||||
#name: Run Python Script on Main Branch |
||||
# |
||||
#on: |
||||
# push: |
||||
# branches: |
||||
# - main |
||||
# workflow_dispatch: |
||||
# |
||||
#jobs: |
||||
# run_script: |
||||
# runs-on: ubuntu-latest |
||||
# |
||||
# steps: |
||||
# - name: Checkout repository |
||||
# uses: actions/checkout@v2 |
||||
# |
||||
# - name: Set up Python |
||||
# uses: actions/setup-python@v2 |
||||
# with: |
||||
# python-version: 3.8 |
||||
# |
||||
# - name: Install dependencies |
||||
# run: | |
||||
# python -m pip install --upgrade pip |
||||
# # Add any other dependencies your script requires here |
||||
# |
||||
# - name: Run Python script |
||||
# run: python convert.py |
||||
# |
||||
# - name: Configure Git |
||||
# run: | |
||||
# git config --local user.email "luoyukongchan@outlook.com" |
||||
# git config --local user.name "Yi Liu" |
||||
# env: |
||||
# GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }} |
||||
# |
||||
# - name: Commit and push JSON file |
||||
# run: | |
||||
# if git status --porcelain | grep -q "urls.json"; then |
||||
# git add urls.json |
||||
# git commit -m "Update urls.json" |
||||
# git push |
||||
# fi |
Loading…
Reference in new issue