From da7eba35795e7ddd78084d139e0c422f2a86707a Mon Sep 17 00:00:00 2001 From: Ruud Senden <8635138+rsenden@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:56:09 +0100 Subject: [PATCH] chore: Fix GitHub URL in `github-pr-comment` fix: `fcli fod action run github-pr-comment`: Use `GITHUB_API_URL` environment variable instead of hardcoded api.github.com to avoid failure on GitHub Enterprise fix: `fcli ssc action run github-pr-comment`: Use `GITHUB_API_URL` environment variable instead of hardcoded api.github.com to avoid failure on GitHub Enterprise --- .../com/fortify/cli/fod/actions/zip/github-pr-comment.yaml | 6 +++++- .../com/fortify/cli/ssc/actions/zip/github-pr-comment.yaml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/fcli-core/fcli-fod/src/main/resources/com/fortify/cli/fod/actions/zip/github-pr-comment.yaml b/fcli-core/fcli-fod/src/main/resources/com/fortify/cli/fod/actions/zip/github-pr-comment.yaml index 5fe8133ad5..84391dcbc2 100644 --- a/fcli-core/fcli-fod/src/main/resources/com/fortify/cli/fod/actions/zip/github-pr-comment.yaml +++ b/fcli-core/fcli-fod/src/main/resources/com/fortify/cli/fod/actions/zip/github-pr-comment.yaml @@ -40,6 +40,10 @@ parameters: description: "Scan type for which to list vulnerabilities. Default value: Static" required: true defaultValue: Static + - name: github-api-url + description: 'Required GitHub API URL. Default value: GITHUB_API_URL environment variable.' + required: true + defaultValue: ${#env('GITHUB_API_URL')} - name: github-token description: 'Required GitHub Token. Default value: GITHUB_TOKEN environment variable.' required: true @@ -68,7 +72,7 @@ parameters: addRequestTargets: - name: github - baseUrl: https://api.github.com + baseUrl: ${parameters['github-api-url']} headers: Authorization: Bearer ${parameters['github-token']} 'X-GitHub-Api-Version': '2022-11-28' diff --git a/fcli-core/fcli-ssc/src/main/resources/com/fortify/cli/ssc/actions/zip/github-pr-comment.yaml b/fcli-core/fcli-ssc/src/main/resources/com/fortify/cli/ssc/actions/zip/github-pr-comment.yaml index 8320cc4bd9..4d0ca2ca7c 100644 --- a/fcli-core/fcli-ssc/src/main/resources/com/fortify/cli/ssc/actions/zip/github-pr-comment.yaml +++ b/fcli-core/fcli-ssc/src/main/resources/com/fortify/cli/ssc/actions/zip/github-pr-comment.yaml @@ -44,6 +44,10 @@ parameters: description: "Analysis type for which to list vulnerabilities. Default value: SCA" required: true defaultValue: SCA + - name: github-api-url + description: 'Required GitHub API URL. Default value: GITHUB_API_URL environment variable.' + required: true + defaultValue: ${#env('GITHUB_API_URL')} - name: github-token description: 'Required GitHub Token. Default value: GITHUB_TOKEN environment variable.' required: true @@ -72,7 +76,7 @@ parameters: addRequestTargets: - name: github - baseUrl: https://api.github.com + baseUrl: ${parameters['github-api-url']} headers: Authorization: Bearer ${parameters['github-token']} 'X-GitHub-Api-Version': '2022-11-28'