Add git completion to containers #4
This file contains hidden or 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
| # Automatically bump patch version on merge to main | |
| name: Version Bump | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| bump-version: | |
| runs-on: ubuntu-latest | |
| # Skip if the commit message contains [skip ci] to avoid infinite loops | |
| if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Bump patch version | |
| run: | | |
| VERSION_FILE="docker/VERSION" | |
| # Read current version | |
| CURRENT_VERSION=$(cat "$VERSION_FILE" | tr -d '[:space:]') | |
| echo "Current version: $CURRENT_VERSION" | |
| # Split into components | |
| IFS='.' read -ra PARTS <<< "$CURRENT_VERSION" | |
| MAJOR="${PARTS[0]:-0}" | |
| MINOR="${PARTS[1]:-0}" | |
| PATCH="${PARTS[2]:-0}" | |
| # Increment patch | |
| NEW_PATCH=$((PATCH + 1)) | |
| NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH" | |
| echo "New version: $NEW_VERSION" | |
| # Write new version | |
| echo "$NEW_VERSION" > "$VERSION_FILE" | |
| # Export for next step | |
| echo "NEW_VERSION=$NEW_VERSION" >> "$GITHUB_ENV" | |
| - name: Commit and push version bump | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add docker/VERSION | |
| git commit -m "chore: bump version to $NEW_VERSION [skip ci]" | |
| git push |