diff --git a/LICENSE b/LICENSE index 261eeb9..cd187e9 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2023 StepSecurity Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 373c1fe..413299b 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,6 @@ -# GitHub Action to Publish Test Results - -![Arm badge](misc/badge-arm.svg) -![Ubuntu badge](misc/badge-ubuntu.svg) -![macOS badge](misc/badge-macos.svg) -![Windows badge](misc/badge-windows.svg) -![XML badge](misc/badge-xml.svg) -![TRX badge](misc/badge-trx.svg) -![JS badge](misc/badge-js.svg) +# StepSecurity Maintained `publish-unit-test-result-action` Action + +Forked from [EnricoMi/publish-unit-test-result-action](https://github.com/EnricoMi/publish-unit-test-result-action) This [GitHub Action](https://github.com/actions) analyses test result files and publishes the results on GitHub. It supports [JSON (Dart, Mocha), TRX (MSTest, VS) and XML (JUnit, NUnit, XUnit) file formats](#generating-test-result-files), diff --git a/action.yml b/action.yml index 682af82..c64a8b4 100644 --- a/action.yml +++ b/action.yml @@ -143,7 +143,7 @@ outputs: runs: using: 'docker' - image: 'docker://ghcr.io/step-security.io/publish-unit-test-result-action:v1.0.1' + image: 'docker://ghcr.io/step-security/publish-unit-test-result-action:v1.0.1' branding: icon: 'check-square' diff --git a/composite/action.yml b/composite/action.yml index 3164bec..67941b3 100644 --- a/composite/action.yml +++ b/composite/action.yml @@ -146,6 +146,24 @@ outputs: runs: using: 'composite' steps: + - name: Validate subscription + shell: bash + run: | + API_URL="https://agent.api.stepsecurity.io/v1/github/$GITHUB_REPOSITORY/actions/subscription" + + # Set a timeout for the curl command (3 seconds) + RESPONSE=$(curl --max-time 3 -s -w "%{http_code}" "$API_URL" -o /dev/null) || true + CURL_EXIT_CODE=${?} + + # Check if the response code is not 200 + if [ $CURL_EXIT_CODE -ne 0 ] || [ "$RESPONSE" != "200" ]; then + if [ -z "$RESPONSE" ] || [ "$RESPONSE" == "000" ] || [ $CURL_EXIT_CODE -ne 0 ]; then + echo "Timeout or API not reachable. Continuing to next step." + else + echo "Subscription is not valid. Reach out to support@stepsecurity.io" + exit 1 + fi + fi - name: Check for Python3 id: python run: |