Merge branch 'main' of https://github.com/DNA-styx/sbpp-windmill-dash… #202
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: Increment value test | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'sbpp-windmill-dashboard/assets/theme_version.txt' | |
- 'sbpp-windmill-dashboard/version.json' | |
- '.github/**' | |
- 'assets/**' | |
- '**.md' | |
- '.gitignore' | |
jobs: | |
test: | |
name: Increment value test | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Increment the 'git' value in version.json | |
- name: Increment Git value | |
id: increment | |
run: | | |
# Extract the current value of "git" as a string and remove quotes | |
git_value=$(jq -r '.git' sbpp-windmill-dashboard/version.json) | |
# Increment the numeric value | |
new_git_value=$((git_value + 1)) | |
# Update the value in the JSON file, ensuring it's saved as a string | |
jq ".git = \"${new_git_value}\"" sbpp-windmill-dashboard/version.json > tmp.json && mv tmp.json sbpp-windmill-dashboard/version.json | |
# Output the new value | |
echo "new_git_value=${new_git_value}" >> $GITHUB_ENV | |
# Step 3: Commit the updated file | |
- name: Commit changes | |
run: | | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git add sbpp-windmill-dashboard/version.json | |
git commit -m "🐳 chore:Inc git value to ${{ env.new_git_value }}" | |
git push |