rrrrrsdf #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Check | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
update-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Git identity | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Github!@#1" | |
- name: Update Plugin Version | |
run: | | |
# Get the current plugin version | |
CURRENT_VERSION=$(grep -o "Version: [0-9]\+\.[0-9]\+\.[0-9]\+" interesttracker-wp-integrator-rabi.php | awk '{print $2}') | |
# Increment the version number (assuming semantic versioning) | |
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{print $1"."$2"."$3+1}') | |
# Update the plugin version in the main plugin file | |
sed -i "s/Version: $CURRENT_VERSION/Version: $NEW_VERSION/" interesttracker-wp-integrator-rabi.php | |
# Commit the changes using the GitHub token for authentication | |
git add interesttracker-wp-integrator-rabi.php | |
git commit -m "Update plugin version to $NEW_VERSION" | |
git push origin main | |
env: | |
GITHUB_TOKEN: ${{ secrets.MY_SECRET_KEY }} |