Update versions #1024
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: Update versions | |
on: | |
schedule: | |
- cron: '0 */6 * * *' | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12.3 | |
- name: Install requirements | |
run: python -m pip install -r ./.github/workflows/requirements.txt | |
- name: Check latest BDS version | |
id: checkver | |
run: | | |
[ -f ./versions.json ] && sha256sum ./versions.json > ./hash1.txt || echo "" > ./hash1.txt | |
python ./.github/workflows/updater.py | |
sha256sum ./versions.json > ./hash2.txt | |
if cmp -s ./hash1.txt ./hash2.txt; then | |
echo "changed=false" >> $GITHUB_OUTPUT | |
else | |
echo "changed=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Commit | |
if: steps.checkver.outputs.changed == 'true' | |
run: | | |
git add versions.json | |
git config --local user.email "69420+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git commit -am "New BDS Version!" | |
- name: Push changes | |
if: steps.checkver.outputs.changed == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |