50 lines
1.8 KiB
YAML
50 lines
1.8 KiB
YAML
name: Check BlueSky Crossposter version
|
|
on:
|
|
schedule:
|
|
- cron: "0 */6 * * *"
|
|
push:
|
|
branches:
|
|
- main # Changez cela si votre branche principale a un autre nom
|
|
|
|
jobs:
|
|
check-version:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
- name: Retrieve latest BlueSky-Crossposter version
|
|
run: |
|
|
mkdir -p /tmp
|
|
git ls-remote https://github.com/Linus2punkt0/bluesky-crossposter.git HEAD \
|
|
| cut -f 1 > /tmp/bluesky_crossposter_latest.txt
|
|
diff bluesky_crossposter_latest.txt /tmp/bluesky_crossposter_latest.txt \
|
|
|| mv /tmp/bluesky_crossposter_latest.txt bluesky_crossposter_latest.txt
|
|
shell: bash
|
|
|
|
- name: Check if version changed
|
|
uses: stefanzweifel/git-auto-commit-action@v5
|
|
id: auto-commit-action
|
|
commit_user_name: My Gitea Actions Bot
|
|
commit_user_email: eric@petite-maison-orange.fr
|
|
commit_author: Gitea Action <servers@coissac.eu>
|
|
commit_message: New bluesky_crossposter_latest version avalaible
|
|
|
|
- name: Send new version to Haoma
|
|
if: steps.auto-commit-action.outputs.changes_detected == 'true'
|
|
run: |
|
|
curl -fsS -m 10 --retry 5 \
|
|
--data-raw "New version avalaible $(cat bluesky_crossposter_latest.txt)" \
|
|
'https://haoma.petite-maison-orange.fr/ping/4f109c94-61e4-4455-9bbd-629431b41ae4'
|
|
shell: bash
|
|
- name: Send no version to Haoma
|
|
if: steps.auto-commit-action.outputs.changes_detected == 'false'
|
|
run: |
|
|
curl -fsS -m 10 --retry 5 \
|
|
--data-raw "No version avalaible stay on $(cat bluesky_crossposter_latest.txt)" \
|
|
'https://haoma.petite-maison-orange.fr/ping/4f109c94-61e4-4455-9bbd-629431b41ae4'
|
|
shell: bash
|