Skip to content

Commit

Permalink
disable update scow-vagrant when in fork
Browse files Browse the repository at this point in the history
  • Loading branch information
ddadaal committed Oct 30, 2024
1 parent d7e6b3d commit 0fbfe0f
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions .github/workflows/side-projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 0fbfe0f

Please sign in to comment.