mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	Fix gha smells
- Avoid incorrectly indented workflows - Prevent running issue/PR actions on forks - Define permissions for workflows with external actions - Use commit hash instead of tags for action versions
This commit is contained in:
		
							
								
								
									
										18
									
								
								.github/workflows/docker.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/workflows/docker.yml
									
									
									
									
										vendored
									
									
								
							@@ -10,18 +10,15 @@ jobs:
 | 
				
			|||||||
    name: Push Docker image to Docker Hub
 | 
					    name: Push Docker image to Docker Hub
 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      -
 | 
					      - name: Check out the repo
 | 
				
			||||||
        name: Check out the repo
 | 
					 | 
				
			||||||
        uses: actions/checkout@v3
 | 
					        uses: actions/checkout@v3
 | 
				
			||||||
      -
 | 
					      - name: Log in to Docker Hub
 | 
				
			||||||
        name: Log in to Docker Hub
 | 
					 | 
				
			||||||
        uses: docker/login-action@v2
 | 
					        uses: docker/login-action@v2
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          username: ${{ secrets.DOCKER_USERNAME }}
 | 
					          username: ${{ secrets.DOCKER_USERNAME }}
 | 
				
			||||||
          password: ${{ secrets.DOCKER_PASSWORD }}
 | 
					          password: ${{ secrets.DOCKER_PASSWORD }}
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
      - 
 | 
					      - name: Extract metadata (tags, labels) for Docker
 | 
				
			||||||
        name: Extract metadata (tags, labels) for Docker
 | 
					 | 
				
			||||||
        id: meta
 | 
					        id: meta
 | 
				
			||||||
        uses: docker/metadata-action@v4
 | 
					        uses: docker/metadata-action@v4
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
@@ -30,16 +27,13 @@ jobs:
 | 
				
			|||||||
            type=raw,value=latest
 | 
					            type=raw,value=latest
 | 
				
			||||||
            type=ref,event=tag
 | 
					            type=ref,event=tag
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
      - 
 | 
					      - name: Set up QEMU
 | 
				
			||||||
        name: Set up QEMU
 | 
					 | 
				
			||||||
        uses: docker/setup-qemu-action@v2
 | 
					        uses: docker/setup-qemu-action@v2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - 
 | 
					      - name: Set up Docker Buildx
 | 
				
			||||||
        name: Set up Docker Buildx
 | 
					 | 
				
			||||||
        uses: docker/setup-buildx-action@v2
 | 
					        uses: docker/setup-buildx-action@v2
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
      - 
 | 
					      - name: Build and push Docker image
 | 
				
			||||||
        name: Build and push Docker image
 | 
					 | 
				
			||||||
        uses: docker/build-push-action@v4
 | 
					        uses: docker/build-push-action@v4
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          context: .
 | 
					          context: .
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										5
									
								
								.github/workflows/issue-translator.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.github/workflows/issue-translator.yml
									
									
									
									
										vendored
									
									
								
							@@ -8,8 +8,11 @@ on:
 | 
				
			|||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
  build:
 | 
					  build:
 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    if: github.repository == 'ChatGPTNextWeb/ChatGPT-Next-Web'
 | 
				
			||||||
 | 
					    permissions: 
 | 
				
			||||||
 | 
					      issues: write
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - uses: usthe/issues-translate-action@v2.7
 | 
					      - uses: usthe/issues-translate-action@b41f55ddc81d7d54bd542a4f289fe28ec081898e # v2.7
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          IS_MODIFY_TITLE: false
 | 
					          IS_MODIFY_TITLE: false
 | 
				
			||||||
          CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically.
 | 
					          CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user