docker-dotclear/.github/workflows/bump_sysInfo.yml
Jean-Christian Paul Denis c0461931ce
Create bump_sysInfo.yml
2024-12-26 21:16:30 +01:00

71 lines
2.2 KiB
YAML

name: Check plugin sysInfo
on:
schedule:
- cron: '35 23 * * *'
workflow_dispatch:
env:
PLUGIN_NAME: sysInfo
PLUGIN_REPO: franck-paul/sysInfo
PLUGIN_ENV: DC_DOCKER_PLUGIN_SYSINFO
jobs:
version:
name: Check versions
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
distant: ${{ steps.distant.outputs.version }}
local: ${{ steps.local.outputs.version }}
steps:
- name: Read distant version
id: repository
uses: oprypin/find-latest-tag@v1.1.2
with:
repository: ${{ env.PLUGIN_REPO }}
- name: Parse distant version
id: distant
run: |
version=${{ steps.repository.outputs.tag }}
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Check out local repository
uses: actions/checkout@v4
- name: Parse local version
id: local
run: |
version=$(sed -n "s/\s*${{ env.PLUGIN_ENV }}=\(.*\)\s\(.*\)/\1/p" ./Dockerfile)
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Summary
run: |
echo '* Distant: ${{ steps.distant.outputs.version }}' >> $GITHUB_STEP_SUMMARY
echo '* Local: ${{ steps.local.outputs.version }}' >> $GITHUB_STEP_SUMMARY
update:
needs: version
name: Update dockerfile
if: (needs.version.outputs.distant != needs.version.outputs.local)
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Set message
id: message
run: |
message=$'Bump ${{ env.PLUGIN_NAME }} from ${{ needs.version.outputs.local }} to ${{ needs.version.outputs.distant }}'
echo "message=${message}" >> $GITHUB_OUTPUT
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Edit file
run: |
sed -i "s/${{ env.PLUGIN_ENV }}=${{ needs.version.outputs.local }}/${{ env.PLUGIN_ENV }}=${{ needs.version.outputs.distant }}/g" ./Dockerfile
- name: Commit change
uses: EndBug/add-and-commit@v9.1.4
with:
default_author: github_actions
message: ${{ steps.message.outputs.message }}
- name: summary
run: echo '* ${{ steps.message.outputs.message }}' >> $GITHUB_STEP_SUMMARY