|
| 1 | +import require$$1 from 'fs'; |
1 | 2 | import require$$0$1 from 'os'; |
2 | 3 | import require$$0$2 from 'crypto'; |
3 | | -import require$$1 from 'fs'; |
4 | 4 | import require$$1$9, { resolve } from 'path'; |
5 | 5 | import require$$2$1 from 'http'; |
6 | 6 | import require$$1$1 from 'https'; |
@@ -81915,45 +81915,46 @@ async function validateSubscription() { |
81915 | 81915 | let repoPrivate; |
81916 | 81916 | const eventPath = process.env.GITHUB_EVENT_PATH; |
81917 | 81917 | if (eventPath && require$$1.existsSync(eventPath)) { |
81918 | | - const payload = JSON.parse(require$$1.readFileSync(eventPath, "utf8")); |
| 81918 | + const payload = JSON.parse(require$$1.readFileSync(eventPath, 'utf8')); |
81919 | 81919 | repoPrivate = payload?.repository?.private; |
81920 | 81920 | } |
81921 | 81921 |
|
81922 | | - const upstream = "amannn/action-semantic-pull-request"; |
| 81922 | + const upstream = 'amannn/action-semantic-pull-request'; |
81923 | 81923 | const action = process.env.GITHUB_ACTION_REPOSITORY; |
81924 | 81924 | const docsUrl = |
81925 | | - "https://docs.stepsecurity.io/actions/stepsecurity-maintained-actions"; |
| 81925 | + 'https://docs.stepsecurity.io/actions/stepsecurity-maintained-actions'; |
81926 | 81926 |
|
81927 | | - core.info(""); |
81928 | | - core.info("\u001b[1;36mStepSecurity Maintained Action\u001b[0m"); |
| 81927 | + core.info(''); |
| 81928 | + core.info('\u001b[1;36mStepSecurity Maintained Action\u001b[0m'); |
81929 | 81929 | core.info(`Secure drop-in replacement for ${upstream}`); |
81930 | | - if (repoPrivate === false) |
81931 | | - core.info("\u001b[32m\u2713 Free for public repositories\u001b[0m"); |
| 81930 | + if (repoPrivate === false) { |
| 81931 | + core.info('\u001b[32m\u2713 Free for public repositories\u001b[0m'); |
| 81932 | + } |
81932 | 81933 | core.info(`\u001b[36mLearn more:\u001b[0m ${docsUrl}`); |
81933 | | - core.info(""); |
| 81934 | + core.info(''); |
81934 | 81935 |
|
81935 | 81936 | if (repoPrivate === false) return; |
81936 | | - const serverUrl = process.env.GITHUB_SERVER_URL || "https://github.com"; |
81937 | | - const body = { action: action || "" }; |
| 81937 | + const serverUrl = process.env.GITHUB_SERVER_URL || 'https://github.com'; |
| 81938 | + const body = {action: action || ''}; |
81938 | 81939 |
|
81939 | | - if (serverUrl !== "https://github.com") body.ghes_server = serverUrl; |
| 81940 | + if (serverUrl !== 'https://github.com') body.ghes_server = serverUrl; |
81940 | 81941 | try { |
81941 | 81942 | await axios.post( |
81942 | 81943 | `https://agent.api.stepsecurity.io/v1/github/${process.env.GITHUB_REPOSITORY}/actions/maintained-actions-subscription`, |
81943 | 81944 | body, |
81944 | | - { timeout: 3000 }, |
| 81945 | + {timeout: 3000} |
81945 | 81946 | ); |
81946 | 81947 | } catch (error) { |
81947 | 81948 | if (axios.isAxiosError(error) && error.response?.status === 403) { |
81948 | 81949 | core.error( |
81949 | | - `\u001b[1;31mThis action requires a StepSecurity subscription for private repositories.\u001b[0m`, |
| 81950 | + `\u001b[1;31mThis action requires a StepSecurity subscription for private repositories.\u001b[0m` |
81950 | 81951 | ); |
81951 | 81952 | core.error( |
81952 | | - `\u001b[31mLearn how to enable a subscription: ${docsUrl}\u001b[0m`, |
| 81953 | + `\u001b[31mLearn how to enable a subscription: ${docsUrl}\u001b[0m` |
81953 | 81954 | ); |
81954 | 81955 | process.exit(1); |
81955 | 81956 | } |
81956 | | - core.info("Timeout or API not reachable. Continuing to next step."); |
| 81957 | + core.info('Timeout or API not reachable. Continuing to next step.'); |
81957 | 81958 | } |
81958 | 81959 | } |
81959 | 81960 |
|
|
0 commit comments