Made check for wether tagged commit is on master more robust
This commit is contained in:
		
							parent
							
								
									06e6c64e49
								
							
						
					
					
						commit
						0d3336b8d9
					
				
							
								
								
									
										9
									
								
								.github/workflows/publish-to-pypi.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.github/workflows/publish-to-pypi.yml
									
									
									
									
										vendored
									
									
								
							@ -19,15 +19,12 @@ jobs:
 | 
			
		||||
 | 
			
		||||
    - name: Verify tag is on master branch
 | 
			
		||||
      run: |
 | 
			
		||||
        TAG_SHA=$(git rev-parse ${{ github.ref }})
 | 
			
		||||
        MASTER_SHA=$(git rev-parse refs/heads/master)
 | 
			
		||||
 | 
			
		||||
        if [ "$TAG_SHA" == "$MASTER_SHA" ]; then
 | 
			
		||||
          echo "Tag is on the master branch. Proceeding with the workflow."
 | 
			
		||||
        else
 | 
			
		||||
        TAG_IS_ON_MASTER=$(git branch -r --contains ${{ github.ref }} | grep 'origin/master')
 | 
			
		||||
        if [ -z "$TAG_IS_ON_MASTER" ]; then
 | 
			
		||||
          echo "Tag is not on the master branch. Cancelling the workflow."
 | 
			
		||||
          exit 1
 | 
			
		||||
        fi
 | 
			
		||||
        echo "Tag is on the master branch. Proceeding with the workflow."
 | 
			
		||||
 | 
			
		||||
    - name: Set up Python
 | 
			
		||||
      uses: actions/setup-python@v4
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										9
									
								
								.github/workflows/publish-to-test-pypi.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.github/workflows/publish-to-test-pypi.yml
									
									
									
									
										vendored
									
									
								
							@ -19,15 +19,12 @@ jobs:
 | 
			
		||||
 | 
			
		||||
    - name: Verify tag is on master branch
 | 
			
		||||
      run: |
 | 
			
		||||
        TAG_SHA=$(git rev-parse ${{ github.ref }})
 | 
			
		||||
        MASTER_SHA=$(git rev-parse refs/heads/master)
 | 
			
		||||
 | 
			
		||||
        if [ "$TAG_SHA" == "$MASTER_SHA" ]; then
 | 
			
		||||
          echo "Tag is on the master branch. Proceeding with the workflow."
 | 
			
		||||
        else
 | 
			
		||||
        TAG_IS_ON_MASTER=$(git branch -r --contains ${{ github.ref }} | grep 'origin/master')
 | 
			
		||||
        if [ -z "$TAG_IS_ON_MASTER" ]; then
 | 
			
		||||
          echo "Tag is not on the master branch. Cancelling the workflow."
 | 
			
		||||
          exit 1
 | 
			
		||||
        fi
 | 
			
		||||
        echo "Tag is on the master branch. Proceeding with the workflow."
 | 
			
		||||
 | 
			
		||||
    - name: Set up Python
 | 
			
		||||
      uses: actions/setup-python@v4
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user