fix workflow #40
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: Checksum | |
on: | |
push: | |
branches: [ "master" ] | |
paths: | |
- 'EasyListHebrew.txt' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Validate existing checksum | |
id: validate_existing_checksum | |
continue-on-error: true | |
run: | | |
python3 .github/scripts/validateChecksum.py EasyListHebrew.txt | |
echo "validation_status=$?" >> $GITHUB_OUTPUT | |
- name: Run checksum update | |
if: ${{ failure() && steps.validate_existing_checksum.conclusion == 'failure' }} | |
id: update_checksum | |
run: | | |
tmpList=$(mktemp) | |
python3 .github/scripts/addChecksum.py EasyListHebrew.txt $tmpList | |
python3 .github/scripts/validateChecksum.py $tmpList | |
if [ $? == 0 ] ; then | |
mv -f $tmpList EasyListHebrew.txt | |
else | |
echo 'something wrong' | |
exit 1 | |
fi | |
- name: Run genhosts | |
id: run_genhost_script | |
run: python3 .github/scripts/genhosts.py EasyListHebrew.txt | |
- name: Check for changes | |
id: git_status | |
run: | | |
git status --porcelain | |
echo "changes=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT | |
- name: Update EasyListHebrew.txt file | |
if: steps.git_status.outputs.changes != '0' | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "[email protected]" | |
git commit -am "Update Checksum" | |
git push |