Merge pull request #12020 from Bo98/workflow-pr-open-fix
workflows: don't assume branch existence means the PR is open
This commit is contained in:
		
						commit
						fb0d764ae7
					
				
							
								
								
									
										4
									
								
								.github/workflows/sorbet.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/sorbet.yml
									
									
									
									
										vendored
									
									
								
							| @ -44,7 +44,6 @@ jobs: | |||||||
|             git reset --hard origin/master |             git reset --hard origin/master | ||||||
|           else |           else | ||||||
|             git checkout -B "$BRANCH" origin/master |             git checkout -B "$BRANCH" origin/master | ||||||
|             BRANCH_EXISTS="1" |  | ||||||
|           fi |           fi | ||||||
| 
 | 
 | ||||||
|           if brew typecheck --update --fail-if-not-changed; then |           if brew typecheck --update --fail-if-not-changed; then | ||||||
| @ -52,7 +51,8 @@ jobs: | |||||||
|             git commit -m "sorbet: Update RBI files." \ |             git commit -m "sorbet: Update RBI files." \ | ||||||
|                        -m "Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow." |                        -m "Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow." | ||||||
|             echo "::set-output name=committed::true" |             echo "::set-output name=committed::true" | ||||||
|             if [ -n "$BRANCH_EXISTS" ]; then |             PULL_REQUEST_STATE=$(gh pr view --json=state 2>/dev/null) | ||||||
|  |             if [ "$PULL_REQUEST_STATE" != "OPEN" ]; then | ||||||
|               echo "::set-output name=pull_request::true" |               echo "::set-output name=pull_request::true" | ||||||
|             fi |             fi | ||||||
|           fi |           fi | ||||||
|  | |||||||
							
								
								
									
										4
									
								
								.github/workflows/spdx.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/spdx.yml
									
									
									
									
										vendored
									
									
								
							| @ -41,14 +41,14 @@ jobs: | |||||||
|             git reset --hard origin/master |             git reset --hard origin/master | ||||||
|           else |           else | ||||||
|             git checkout -B "$BRANCH" origin/master |             git checkout -B "$BRANCH" origin/master | ||||||
|             BRANCH_EXISTS="1" |  | ||||||
|           fi |           fi | ||||||
| 
 | 
 | ||||||
|           if brew update-license-data --fail-if-not-changed; then |           if brew update-license-data --fail-if-not-changed; then | ||||||
|             git add "$GITHUB_WORKSPACE/Library/Homebrew/data/spdx" |             git add "$GITHUB_WORKSPACE/Library/Homebrew/data/spdx" | ||||||
|             git commit -m "spdx: update license data." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/spdx.yml)." |             git commit -m "spdx: update license data." -m "Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/spdx.yml)." | ||||||
|             echo "::set-output name=committed::true" |             echo "::set-output name=committed::true" | ||||||
|             if [ -n "$BRANCH_EXISTS" ]; then |             PULL_REQUEST_STATE=$(gh pr view --json=state 2>/dev/null) | ||||||
|  |             if [ "$PULL_REQUEST_STATE" != "OPEN" ]; then | ||||||
|               echo "::set-output name=pull_request::true" |               echo "::set-output name=pull_request::true" | ||||||
|             fi |             fi | ||||||
|           fi |           fi | ||||||
|  | |||||||
							
								
								
									
										4
									
								
								.github/workflows/update-man-completions.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/update-man-completions.yml
									
									
									
									
										vendored
									
									
								
							| @ -49,7 +49,6 @@ jobs: | |||||||
|             git reset --hard origin/master |             git reset --hard origin/master | ||||||
|           else |           else | ||||||
|             git checkout -B "$BRANCH" origin/master |             git checkout -B "$BRANCH" origin/master | ||||||
|             BRANCH_EXISTS="1" |  | ||||||
|           fi |           fi | ||||||
| 
 | 
 | ||||||
|           if [ "${{github.event_name}}" != "push" ]; then |           if [ "${{github.event_name}}" != "push" ]; then | ||||||
| @ -64,7 +63,8 @@ jobs: | |||||||
|             git commit -m "Update maintainers, manpage and completions." \ |             git commit -m "Update maintainers, manpage and completions." \ | ||||||
|                        -m "Autogenerated by the [update-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/update-man-completions.yml) workflow." |                        -m "Autogenerated by the [update-man-completions](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/update-man-completions.yml) workflow." | ||||||
|             echo "::set-output name=committed::true" |             echo "::set-output name=committed::true" | ||||||
|             if [ -n "$BRANCH_EXISTS" ]; then |             PULL_REQUEST_STATE=$(gh pr view --json=state 2>/dev/null) | ||||||
|  |             if [ "$PULL_REQUEST_STATE" != "OPEN" ]; then | ||||||
|               echo "::set-output name=pull_request::true" |               echo "::set-output name=pull_request::true" | ||||||
|             fi |             fi | ||||||
|           fi |           fi | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Bo Anderson
						Bo Anderson