]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(CI): Fix compile command 46559/head
authorJoas Schilling <coding@schilljs.com>
Tue, 16 Jul 2024 11:35:54 +0000 (13:35 +0200)
committerJoas Schilling <coding@schilljs.com>
Tue, 16 Jul 2024 11:35:54 +0000 (13:35 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
.github/workflows/command-compile.yml

index c071899bd02ce6704c7aee140e28a4146a1cd4c1..5c59aa23569e2d5c15254c03305d537635971856 100644 (file)
@@ -26,8 +26,24 @@ jobs:
       base_ref: ${{ steps.comment-branch.outputs.base_ref }}
 
     steps:
+      - name: Get repository from pull request comment
+        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
+        id: get-repository
+        with:
+          github-token: ${{secrets.GITHUB_TOKEN}}
+          script: |
+            const pull = await github.rest.pulls.get({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              pull_number: context.issue.number
+            });
+
+            const repositoryName = pull.data.head?.repo?.full_name
+            console.log(repositoryName)
+            return repositoryName
+
       - name: Disabled on forks
-        if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
+        if: ${{ fromJSON(steps.get-repository.outputs.result) != github.repository }}
         run: |
           echo 'Can not execute /compile on forks'
           exit 1