Skip to content

codesnippetspro/svn-binary

Repository files navigation

svn-binary

License: MIT GitHub Release

A GitHub Action that provides the Subversion (SVN) command-line interface in CI/CD workflows by running a containerized SVN installation and exposing it to the runner PATH.

Overview

This action eliminates the need to install Subversion on every workflow run by leveraging a pre-built Docker container. The container runs as a background service, and a lightweight wrapper script forwards svn commands to the containerized binary via docker exec.

Key Benefits

  • Reduced build time: Avoids repeated apt-get install operations on every workflow run
  • Consistent environment: Uses a fixed Subversion version from a controlled container image
  • Minimal overhead: Container images are cached by GitHub Actions infrastructure
  • Drop-in replacement: Existing svn commands work without modification

Installation

Add the action to your workflow:

- name: Install SVN Binary
  uses: codesnippetspro/svn-binary@v1

Usage

Basic Usage

Use the default latest version:

- name: Install SVN Binary
  uses: codesnippetspro/svn-binary@v1

- name: Run SVN commands
  run: |
    svn --version
    svn checkout https://svn.example.com/repo/trunk

Specify Version

Pin to a specific version:

- name: Install SVN Binary
  uses: codesnippetspro/svn-binary@v1
  with:
    version: v1.0.0

Complete Workflow Example

name: Deploy to SVN Repository

on:
  release:
    types: [published]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install SVN Binary
        uses: codesnippetspro/svn-binary@v1
        with:
          version: latest

      - name: Deploy to SVN
        env:
          SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
          SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
        run: |
          svn checkout https://plugins.svn.example.org/my-plugin svn-repo
          cp -r dist/* svn-repo/trunk/
          cd svn-repo
          svn add . --force
          svn commit -m "Release ${{ github.ref_name }}" \
            --username "$SVN_USERNAME" \
            --password "$SVN_PASSWORD" \
            --no-auth-cache \
            --non-interactive

Configuration

Inputs

Input Description Required Default
version Container image version tag (e.g., v1.0.0, latest) No latest
image Full container image path (overrides version-based image selection) No ghcr.io/{owner}/svn-binary:{version}
container_name Container name prefix (unique suffix appended automatically) No svn-binary-svc

Outputs

This action does not produce outputs. After execution, the svn command is available in the runner PATH for subsequent workflow steps.

Requirements

  • Docker must be available on the runner (pre-installed on GitHub-hosted ubuntu-latest runners)
  • Network access to GitHub Container Registry (ghcr.io) for image pulls
  • Sufficient runner permissions to execute docker run and docker exec

Architecture

The action performs the following operations:

  1. Container Launch: Starts a detached Docker container running sleep infinity
  2. Wrapper Creation: Generates a shell script at $RUNNER_TEMP/svn-bin/svn that forwards commands to the container via docker exec
  3. PATH Modification: Appends the wrapper directory to $GITHUB_PATH for subsequent steps

The container uses a unique name based on the GitHub run ID to prevent conflicts in concurrent workflows.

Limitations

  • Docker dependency: Requires Docker on the runner; not compatible with runners lacking Docker support
  • Network overhead: First run or cache miss requires pulling the container image (typically 50-150 MB)
  • Linux only: Designed for Linux runners; macOS and Windows support not tested
  • Container lifecycle: The container runs for the duration of the workflow job; manual cleanup may be required if the job terminates abnormally

Development

Building Locally

# Build the container image
docker build -t svn-binary:local .

# Test locally
docker run --rm svn-binary:local --version

Running Tests

# Install dependencies
npm install

# Build action
npm run build

# Run smoke tests
docker build -t svn-binary:test .
docker run --rm svn-binary:test --version

Contributing

Contributions are welcome. Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/improvement)
  3. Commit changes with clear messages
  4. Submit a pull request with a description of changes

For bug reports and feature requests, please open an issue with detailed information.

License

This project is licensed under the MIT License. See LICENSE for details.

Acknowledgments

This action is maintained by Code Snippets Pro and is designed to support automated deployment workflows for WordPress plugins and other SVN-based repositories.

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages