Skip to content

[GRM] 난이도2 / 폴더 폰 자판 / 73분 #72

[GRM] 난이도2 / 폴더 폰 자판 / 73분

[GRM] 난이도2 / 폴더 폰 자판 / 73분 #72

Workflow file for this run

name: Update Readme
on:
pull_request:
types: [closed]
jobs:
run-script:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r script/requirements.txt
- name: Check token
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
if [ -z "$ACCESS_TOKEN" ]; then
echo "TOKEN is not set"
else
echo "TOKEN is set"
fi
- name: Run python script
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
working-directory: ./script
run: python collector.py
- name: Check for changes in README.md
id: check_changes
run: |
if git diff --exit-code README.md; then
echo "no changes"
echo "changes=false" >> $GITHUB_ENV
else
echo "Changes detected"
echo "changes=true" >> $GITHUB_ENV
fi
- name: Commit and push changes
if: env.changes == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add README.md
git commit -m "Update README.md"
git push