From 0fbfe0f1102500540ae45731299aecc27abd803e Mon Sep 17 00:00:00 2001 From: Chen Junda Date: Wed, 30 Oct 2024 19:25:22 +0800 Subject: [PATCH] disable update scow-vagrant when in fork --- .github/workflows/side-projects.yaml | 29 ++-------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/.github/workflows/side-projects.yaml b/.github/workflows/side-projects.yaml index c572669d9a..e1eb6cfe18 100644 --- a/.github/workflows/side-projects.yaml +++ b/.github/workflows/side-projects.yaml @@ -17,36 +17,11 @@ env: jobs: - openscow-vagrant-check: - name: Check if the user has write permission to vagrant repo - runs-on: ubuntu-latest - permissions: read-all - outputs: - has_write_permission: ${{ steps.check-permission.outputs.result }} - steps: - - - name: Check if the user has write permission to ${{ env.VAGRANT_ORG }}/${{ env.VAGRANT_REPO }} - id: check-permission - uses: actions/github-script@v6 - with: - script: | - const { data: { permission } } = await github.rest.repos.getCollaboratorPermissionLevel({ - owner: '${{ env.VAGRANT_ORG }}', - repo: '${{ env.VAGRANT_REPO }}', - username: context.actor, - }); - - console.log(`The user has ${permission} permission to ${env.VAGRANT_ORG}/${env.VAGRANT_REPO}`); - - return permission === 'admin' || permission === 'write'; - - openscow-vagrant: - name: Update openscow-vagrant + name: Update openscow-vagrant if not from fork runs-on: ubuntu-latest - needs: openscow-vagrant-check - if: needs.openscow-vagrant-check.outputs.has_write_permission == 'true' + if: github.event.pull_request.head.repo.fork == false steps: