GHA-169 Normalize Jira version names by removing .0 patch suffix #97
Workflow file for this run
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
| name: Test Create Jira Version Action | |
| on: | |
| workflow_call: | |
| pull_request: | |
| paths: | |
| - 'create-jira-version/**' | |
| - '.github/workflows/test-create-jira-version.yml' | |
| push: | |
| branches: | |
| - branch-* | |
| paths: | |
| - 'create-jira-version/**' | |
| - '.github/workflows/test-create-jira-version.yml' | |
| workflow_dispatch: | |
| jobs: | |
| unit-tests: | |
| name: Run Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| cd create-jira-version | |
| pip install -r requirements.txt | |
| pip install pytest pytest-cov | |
| - name: Run unit tests | |
| run: | | |
| cd create-jira-version | |
| python -m pytest test_create_jira_version.py -v --cov=create_jira_version --cov-report=term-missing | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Test with explicit new version name | |
| id: test-explicit | |
| uses: ./create-jira-version | |
| with: | |
| jira-project-key: 'TESTPROJ' | |
| jira-new-version-name: '1.2.3' | |
| use-jira-sandbox: 'true' | |
| continue-on-error: true | |
| - name: Verify explicit version test outputs | |
| run: | | |
| echo "Test with explicit new version name:" | |
| echo "Expected to fail due to missing credentials (which is expected in CI)" | |
| echo "Action should have determined new-version-name as: 1.2.3" | |
| - name: Test with current version (auto-increment) | |
| id: test-auto | |
| uses: ./create-jira-version | |
| with: | |
| jira-project-key: 'TESTPROJ' | |
| jira-version-name: '1.2.2' | |
| use-jira-sandbox: 'true' | |
| continue-on-error: true | |
| - name: Verify auto-increment test outputs | |
| run: | | |
| echo "Test with current version (should auto-increment):" | |
| echo "Expected to fail due to missing credentials (which is expected in CI)" | |
| echo "Action should have determined new-version-name as: 1.2.3" | |
| - name: Test with environment variables | |
| id: test-env | |
| uses: ./create-jira-version | |
| env: | |
| JIRA_PROJECT_KEY: 'TESTPROJ' | |
| JIRA_VERSION_NAME: '2.0.1' | |
| USE_JIRA_SANDBOX: 'true' | |
| continue-on-error: true | |
| - name: Verify environment variables test | |
| run: | | |
| echo "Test with environment variables:" | |
| echo "Expected to fail due to missing credentials (which is expected in CI)" | |
| echo "Action should have determined new-version-name as: 2.0.2" | |
| - name: Test with special characters in version names | |
| id: test-special-chars | |
| uses: ./create-jira-version | |
| with: | |
| jira-project-key: 'TESTPROJ' | |
| jira-version-name: '1.2.3-"beta"' | |
| jira-new-version-name: '1.2.4-"rc1"' | |
| use-jira-sandbox: 'true' | |
| continue-on-error: true | |
| - name: Verify special characters test | |
| run: | | |
| echo "Test with special characters in version names:" | |
| echo "Expected to fail due to missing credentials (which is expected in CI)" | |
| echo "Action should handle version names with quotes without syntax errors" | |
| echo "Test outcome: ${{ steps.test-special-chars.outcome }}" | |
| echo "✓ Action handles quotes and special characters in version names" |