Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Auto Sync WordPress Release #13

Auto Sync WordPress Release

Auto Sync WordPress Release #13

Workflow file for this run

name: Auto Sync WordPress Release
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
fetch:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get latest git release
id: get-latest-release
run: |
LATEST_RELEASE=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "release=$LATEST_RELEASE" >> $GITHUB_OUTPUT
- name: Install dependencies
run: |
sudo apt install -y jq curl
- name: Get latest WordPress version
id: get-wordpress-version
run: |
LATEST_VERSION=$(curl -s https://api.wordpress.org/core/version-check/1.7/ | jq -r '.offers[0].current')
echo "Latest WordPress version is $LATEST_VERSION"
echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT
- name: Create release
uses: softprops/action-gh-release@v2
if: steps.get-latest-release.outputs.release != steps.get-wordpress-version.outputs.version
with:
tag_name: ${{ steps.get-wordpress-version.outputs.version }}
name: ${{ steps.get-wordpress-version.outputs.version }}
body: "WordPress version ${{ steps.get-wordpress-version.outputs.version }}"
draft: false
make_latest: "true"