Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't retrieve outputs from SecHub GitHub Action #3481

Open
adobryn opened this issue Oct 2, 2024 · 5 comments · May be fixed by #3570
Open

Can't retrieve outputs from SecHub GitHub Action #3481

adobryn opened this issue Oct 2, 2024 · 5 comments · May be fixed by #3570
Assignees
Labels
bug Something isn't working github-action

Comments

@adobryn
Copy link

adobryn commented Oct 2, 2024

Situation

I have a workflow that uses SecHub scan action outputs and sends a message to a Teams channel. It worked fine, but since last Friday, all output values have been null without any code changes from my side:

      - id: sechub_scan
        uses: mercedes-benz/sechub/github-actions/scan@master
        with:
          url: https://sechub.url/
          api-token: ${{ API_TOKEN }}
          user: ${{ USER }}
          project-name: 'project'
          version: 'latest'
          scan-types: codeScan, secretScan
          report-formats: 'html'
          fail-job-with-findings: true
          
      - name: Check SecHub scan traffic light
        run: |
          echo "DEBUG: Scan traffic light: ${{ steps.sechub_scan.outputs.scan-trafficlight }}"
          echo "DEBUG: Scan summary: ${{ steps.sechub_scan.outputs.scan-readable-summary }}"

Further investigation

Debugging showed that the SecHub action creates the outputs:

##[debug]Set output scan-trafficlight = GREEN
##[debug]Set output scan-findings-count = 0
##[debug]Set output scan-findings-high = 0
##[debug]Set output scan-findings-medium = 0
##[debug]Set output scan-findings-low = 0
##[debug]Set output scan-readable-summary = SecHub reported traffic light color GREEN without findings

but they can't be retrieved in the next action :

##[debug]', steps.sechub_scan.outputs.scan-trafficlight, steps.sechub_scan.outputs.scan-readable-summary)
##[debug]Evaluating format:
##[debug]..Evaluating String:
##[debug]..=> 'echo "DEBUG: Scan traffic light: {0}"
##[debug]echo "DEBUG: Scan summary: {1}"
##[debug]'
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating Index:
##[debug]........Evaluating steps:
##[debug]........=> Object
##[debug]........Evaluating String:
##[debug]........=> 'sechub_scan'
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'outputs'
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'scan-trafficlight'
##[debug]..=> null
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating Index:
##[debug]........Evaluating steps:
##[debug]........=> Object
##[debug]........Evaluating String:
##[debug]........=> 'sechub_scan'
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'outputs'
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'scan-readable-summary'
##[debug]..=> null
##[debug]=> 'echo "DEBUG: Scan traffic light: "
##[debug]echo "DEBUG: Scan summary: "
##[debug]'
##[debug]Result: 'echo "DEBUG: Scan traffic light: "
##[debug]echo "DEBUG: Scan summary: "

I also tried waiting 20 seconds to ensure the action was completed and used if: always(), but it didn't help.

Do you have any suggestions on how to resolve this? Thank you for your help!

upd: with previous version of client 1.7.0 everything works as expected

@haerter-tss
Copy link
Member

Thank you for bringing this to our attention!
We will look into this issue and let you know once we know more.

@haerter-tss
Copy link
Member

@adobryn We had a bug in our Github Action, the scan was started in a wrong directory. The issue was fixed and a new version of the Action has been released. Please rerun your scans and check if everything is now working for you.

@haerter-tss haerter-tss assigned haerter-tss and unassigned sven-dmlr Oct 10, 2024
@haerter-tss haerter-tss added the bug Something isn't working label Oct 10, 2024
@haerter-tss
Copy link
Member

Apparently the fix of the Github Action did not help with this bug

@sven-dmlr sven-dmlr self-assigned this Oct 16, 2024
@sven-dmlr
Copy link
Member

Could reproduce the behavior.

  • mercedes-benz/sechub/github-actions/scan@master

    • empty variables with 'latest' / SecHub client 1.8.1
    • empty variables with SecHub client 1.7.0
  • Action code from Mo 10. Jun 16:48:23 CEST 2024 (last release)

    • works as expected for 'latest' / SecHub client 1.8.1
    • works as expected for SecHub client 1.7.0

Bottom line: The latest action produces the problem.

@sven-dmlr
Copy link
Member

Maybe the thread here is helpful: actions/toolkit#1218

@sven-dmlr sven-dmlr assigned hamidonos and unassigned sven-dmlr Oct 17, 2024
sven-dmlr added a commit that referenced this issue Oct 28, 2024
sven-dmlr added a commit that referenced this issue Oct 28, 2024
also print content of action.yml
sven-dmlr added a commit that referenced this issue Oct 28, 2024
sven-dmlr added a commit that referenced this issue Oct 28, 2024
sven-dmlr added a commit that referenced this issue Oct 28, 2024
sven-dmlr added a commit that referenced this issue Oct 28, 2024
sven-dmlr added a commit that referenced this issue Oct 28, 2024
sven-dmlr added a commit that referenced this issue Oct 30, 2024
but with recent core library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working github-action
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants