Skip to content

refactor to get version properly #16

refactor to get version properly

refactor to get version properly #16

Workflow file for this run

name: Check licenses
on:
push:
branches-ignore:
- master
- version-*
- dependabot**
paths-ignore:
- README.md
env:
APP_NAME: ${{ github.repository }}
BRANCH: ${{ github.ref }}
runsOn: "ubuntu-20.04"
jobs:
prebuild-job:
name: Prebuild Job
uses: th2-net/.github/.github/workflows/compound-prebuild-java-dev-workflow.yml@main
with:
runsOn: ${{ env.runsOn }}

Check failure on line 22 in .github/workflows/license_check.yml

View workflow run for this annotation

GitHub Actions / Check licenses

Invalid workflow file

The workflow is not valid. .github/workflows/license_check.yml (Line: 22, Col: 15): Unrecognized named-value: 'env'. Located at position 1 within expression: env.runsOn .github/workflows/license_check.yml (Line: 25, Col: 14): Unrecognized named-value: 'env'. Located at position 1 within expression: env.runsOn
check_licenses:
runs-on: ${{ env.runsOn }}
needs: [prebuild-job]
steps:
- name: checkout actions
uses: actions/checkout@v4
- name: Install jq env
run: |
sudo apt-get update
sudo apt-get install -y jq
- name: Download script
run: |
wget -q -O check_licenses.sh https://raw.githubusercontent.com/th2-net/.github/th2-1836-json-files-update/license-compliance/check_licenses.sh
chmod +x ./check_licenses.sh
- name: Run check_licenses script
run: ./check_licenses.sh java
id: run_script
# - name: Get version
# run:
# echo "${{ github.ref }}" | awk -F '/' '{print $NF}' > $VERSION
# echo "${{ github.repository }}" | awk -F '/' '{print $NF}' > $APP_NAME
- name: Uploading results
if: always()
uses: actions/upload-artifact@v3
with:
name: licenses_check-${{ needs.prebuild-job.outputs.version }}
path: ./licenses_check/
- name: Results checking
id: result-check
run: |
line_count=$(wc -l < ./licenses_check/failed_licenses.csv)
if [[ $line_count -gt 1 ]]; then
echo "FAILED due to unknown/failed licenses found"
exit 1
else
echo "PASSED: licenses check successfull"
exit 0
fi
continue-on-error: false
# - name: Set workflow status
# run: echo "::set-output name=status::Failure"
# if: steps.set_status.outputs.result == 'FAILED due to unknown licenses found'
# continue-on-error: false