Skip to content

Commit

Permalink
Merge pull request #146 from Graur/141
Browse files Browse the repository at this point in the history
updated daily script
  • Loading branch information
yegor256 committed Jun 26, 2023
2 parents a9a9a66 + c904ced commit d350df5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Check releases
name: releases

on:
schedule:
- cron: "0 0 * * *"
- cron: "0 * * * *"

jobs:
check-releases:
Expand All @@ -15,21 +15,24 @@ jobs:
sudo apt-get update
sudo apt-get install -y python3 python3-pip
pip3 install requests
- name: install pdd
- name: install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: install pdd
run: gem install pdd
- name: pull releases
id: daily_script
run: |
python3 auto-pull.py
echo "::set-output name=result_param::COMMIT_MESSAGE"
- name: create pull request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.TOKEN }}
commit-message: Automated update of available list of releases
title: Automated update of available list of releases
body: Automated update of available list of releases
commit-message: New release for {{ steps.daily_script.outputs.result_param }}
title: New release for {{ steps.daily_script.outputs.result_param }}
body: New release for {{ steps.daily_script.outputs.result_param }}
base: master
branch: automated-release-update
branch: update-{{ steps.daily_script.outputs.result_param }}
delete-branch: true
6 changes: 4 additions & 2 deletions auto-pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@
response.raise_for_status()
latest_version = response.json()['tag_name']
if latest_version > version:
print(f'New release for {name}: {latest_version}')
os.system(f'./pull.sh objectionary/{name}')
os.system(f'./pull.sh objectionary/{name}')
COMMIT_MESSAGE = f'{name}:{latest_version}'
print(COMMIT_MESSAGE)
break

0 comments on commit d350df5

Please sign in to comment.