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

Running action inside of container does not work #3

Closed
natlibfi-jonollil opened this issue Feb 20, 2024 · 4 comments
Closed

Running action inside of container does not work #3

natlibfi-jonollil opened this issue Feb 20, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@natlibfi-jonollil
Copy link

  license-scan:
    name: License compliance check
    runs-on: ubuntu-latest
    container: docker://node:20

    steps:
      - uses: actions/checkout@v4
      - uses: mikaelvesavuori/license-compliance-action@v1.0.2

My deduction is that location of script.sh file is not in same place as in the runner.
https://github.com/NatLibFi/melinda-ui-commons/actions/runs/7970133107/job/21757144607

@mikaelvesavuori
Copy link
Owner

Interesting... In the action, this line tries to get the action path:

- run: ${{ github.action_path }}/script.sh "${{ inputs.allow_licenses }}" "${{ inputs.nested_field }}" "${{ inputs.exclude_pattern }}"

And the paths seem broken in containers: actions/runner#716

Will see if I can fix this with the workarounds mentioned.

@mikaelvesavuori mikaelvesavuori self-assigned this Feb 20, 2024
@mikaelvesavuori
Copy link
Owner

mikaelvesavuori commented Feb 20, 2024

Hi @natlibfi-jonollil!

This should now be solved in https://github.com/mikaelvesavuori/license-compliance-action/releases/tag/v1.0.3. You can use either @v1 or @v1.0.3.

Leaving a proof at https://github.com/mikaelvesavuori/license-container-test/actions/runs/7972722614/job/21765071766 that (to the best of my ability) demonstrates it working. If you're not seeing logs then I'm having the same issue too...? At least checking the raw logs makes it look like it does its thing without breaking:

2024-02-20T11:27:17.2835524Z ##[group]Run mikaelvesavuori/license-compliance-action@v1
2024-02-20T11:27:17.2836227Z with:
2024-02-20T11:27:17.2836634Z   allow_licenses: MIT;ISC;0BSD;BSD-2-Clause;BSD-3-Clause;Apache-2.0
2024-02-20T11:27:17.2837149Z ##[endgroup]
2024-02-20T11:27:17.3146370Z ##[group]Run $GITHUB_ACTION_PATH/script.sh "MIT;ISC;0BSD;BSD-2-Clause;BSD-3-Clause;Apache-2.0" "" ""
2024-02-20T11:27:17.3147429Z �[36;1m$GITHUB_ACTION_PATH/script.sh "MIT;ISC;0BSD;BSD-2-Clause;BSD-3-Clause;Apache-2.0" "" ""�[0m
2024-02-20T11:27:17.3151695Z shell: bash --noprofile --norc -e -o pipefail {0}
2024-02-20T11:27:17.3152237Z ##[endgroup]
2024-02-20T11:27:17.4051001Z LICENSES is: MIT;ISC;0BSD;BSD-2-Clause;BSD-3-Clause;Apache-2.0
2024-02-20T11:27:17.4051533Z NESTED_FIELD is: 
2024-02-20T11:27:17.4052044Z EXCLUDE_PATTERN is: 
2024-02-20T11:27:17.4238935Z Stop and remove container: fafd90d7765a49d29680fee8e2382500_node20_eb7d61

@mikaelvesavuori mikaelvesavuori added the enhancement New feature or request label Feb 20, 2024
@mikaelvesavuori
Copy link
Owner

Will close this. Feel free to open or comment if this is indeed not working.

@natlibfi-jonollil
Copy link
Author

Thanks! Works nicely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants