add form download script #9
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: Quality Assurance | |
on: | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: '0 0 * * *' # This cron expression runs the workflow every day at midnight UTC | |
env: | |
CURRENT_FORM_VERSION: "DPFOBv23" | |
jobs: | |
download: | |
name: Download Form File | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Download config file | |
run: wget https://edane.financnasprava.sk/java/prod/eform/config.xml -O config.xml | |
- name: Filter only for Danove Priznanie Files | |
run: | | |
grep -i "DPFO" config.xml | grep "ElektronickyFormular" > dp.out | |
cat dp.out | |
ZIP_URL=$(grep -i $CURRENT_FORM_VERSION dp.out | sed -n 's/.*Url="\([^"]*\)".*/\1/p') | |
echo $ZIP_URL | |
wget $ZIP_URL -O form.zip | |
- name: Check if new version is available | |
id: check-step | |
run: | | |
md5sum form.zip | |
md5sum form.zip > ./public/form.zip.md5 | |
if git diff --exit-code ./public/form.zip.md5; then | |
echo "skipnext=true" >> $GITHUB_OUTPUT | |
else | |
echo "skipnext=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Unzip form files | |
if : ( steps.check-step.outputs.skipnext != 'true' ) | |
run: | | |
echo "will only run if skipnext is not true" | |
unzip form.zip -d ./public | |
ls -ls ./public | |