Skip to content

Clone wp post

Clone wp post #15

Workflow file for this run

name: Clone Post
description: Clone WordPress post
inputs:
environment:
description: 'The deployment environment (QA, SBOX, PROD)'
required: true
postID:
description: 'The ID of the post to clone'
required: true
runs:
using: 'composite'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Run cloning script
run: |
python wordpress-cloning-script.py ${{ inputs.environment }} ${{ inputs.postID }} ${{ inputs.WORDPRESS_USERNAME }} ${{ inputs.WORDPRESS_PASSWORD }}
- name: Configure git user
run: |
git config user.name 'GitHub Actions'
git config user.email '[email protected]'
- name: Commit and push changes
run: |
git add .
if git diff --staged --quiet; then
echo "No changes to commit."
else
git commit -m "Cloned WordPress post ${{ inputs.postID }} for environment ${{ inputs.environment }}"
git push