Skip to content

first github actions test #3

first github actions test

first github actions test #3

name: Get Services Status
on:
schedule:
- cron: '*/5 * * * *' # See https://crontab.guru/#0_0/2_*_*_* for help
workflow_dispatch: # Permette l'avvio manuale del workflow
jobs:
get-services-status:
runs-on: "composite"
steps:
- name: Checkout Main Branch

Check failure on line 13 in .github/workflows/get-services-status.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/get-services-status.yml

Invalid workflow file

You have an error in your yaml syntax on line 13
uses: actions/checkout@v3
with:
ref: main
- name: Checkout Data Branch
uses: actions/checkout@v3
with:
ref: data
path: data
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install Python dependencies
shell: bash
run: python -m pip install -r ${{ github.action_path }}/action-requirements.txt
- name: Get Services Status
id: "get-services-status"
shell: bash
run: |
UPDATE=$(python ${{ github.action_path }}/scripts/actions/get-services-status.py
) || exit 1
echo "markdown=$(echo $UPDATE)" >> $GITHUB_OUTPUT
- name: Commit Changes
shell: bash
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# Aggiungi i file modificati
git add .
# Verifica se ci sono cambiamenti rispetto al commit precedente
if git diff-index --quiet HEAD --; then
echo "Nessun cambiamento rilevato, niente da aggiornare."
else
git commit -m "Update weather data"
git push origin data
fi
working-directory: data