Skip to content

Commit

Permalink
Modify two errors in create-job-badge and license-scan workflow. (int…
Browse files Browse the repository at this point in the history
…el-analytics#5718)

* add create-job-status-badge action

* add selfHostedRunner input

* add create badge job

* change isSelfHostedRunner to is-self-hosted-runner

* update create-job-status-badge

* adjust indent
  • Loading branch information
Zephyr596 authored and ForJadeForest committed Sep 20, 2022
1 parent e233fc3 commit 57fd7ca
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
10 changes: 8 additions & 2 deletions .github/actions/create-job-status-badge/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ runs:
run: if [ ${{ env.JOB-STATUS }} == "success" ] ; then echo "COLOR=green" >> $GITHUB_ENV ; else echo "COLOR=red" >> $GITHUB_ENV; fi

- name: Create job badge
if: ${{ inputs.type == 'job' }}
if: ${{ inputs.type == 'job' && inputs.secret != '' }}
uses: analytics-zoo/dynamic-badges-action@master
with:
auth: ${{ inputs.secret }}
Expand All @@ -49,7 +49,7 @@ runs:
color: ${{ env.COLOR }}

- name: Create time badge
if: ${{ inputs.type == 'workflow' }}
if: ${{ inputs.type == 'workflow' && inputs.secret != '' }}
uses: analytics-zoo/dynamic-badges-action@master
with:
auth: ${{ inputs.secret }}
Expand All @@ -58,3 +58,9 @@ runs:
filename: ${{ inputs.file-name }}
label: Time is
message: ${{ env.TIME }}

- name: print error message
if: ${{ inputs.secret == '' }}
shell: bash
run: |
echo "Can not get secret! Please check out your workflow!(mainly caused by pr trigger)"
48 changes: 24 additions & 24 deletions .github/workflows/license-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ jobs:
fossa-scan:
runs-on: ubuntu-latest
steps:
- name: "Checkout Code"
uses: actions/checkout@v3
- name: "Checkout Code"
uses: actions/checkout@v3

- name: "Run FOSSA Scan"
uses: fossas/fossa-action@main # Use a specific version if locking is preferred
with:
api-key: ${{ secrets.FOSSAAPIKEY }}
- name: "Run FOSSA Test"
uses: fossas/fossa-action@main # Use a specific version if locking is preferred
with:
api-key: ${{ secrets.FOSSAAPIKEY }}
run-tests: true
- name: "Filter the Dependency Tree"
- name: "Run FOSSA Scan"
uses: fossas/fossa-action@main # Use a specific version if locking is preferred
with:
api-key: ${{ secrets.FOSSAAPIKEY }}

- name: "Run FOSSA Test"
uses: fossas/fossa-action@main # Use a specific version if locking is preferred
with:
api-key: ${{ secrets.FOSSAAPIKEY }}
run-tests: true

- name: "Filter the Dependency Tree"
if: ${{ failure() }}
run: |
sed -i 's/<artifactId>${spark-version.project}<\/artifactId>/<artifactId>${spark-version.project}-${SPARK_PLATFORM}<\/artifactId>/' scala/dllib/pom.xml
Expand All @@ -47,16 +47,16 @@ jobs:
cd scala
mvn -P spark_3.x dependency:tree -Dspark.version=3.1.2 -DSPARK_PLATFORM=SPARK_3.1
- name: Create Job Badge
if: ${{ always() }}
uses: ./.github/actions/create-job-status-badge
with:
secret: ${{ secrets.GIST_SECRET }}
gist-id: f91eb10af4d9dbe216ba0f0da71cace9
is-self-hosted-runner: false
file-name: fossa-scan.json
type: job
job-name: fossa-scan
- name: Create Job Badge
if: ${{ always() }}
uses: ./.github/actions/create-job-status-badge
with:
secret: ${{ secrets.GIST_SECRET }}
gist-id: f91eb10af4d9dbe216ba0f0da71cace9
is-self-hosted-runner: false
file-name: fossa-scan.json
type: job
job-name: fossa-scan


create-workflow-badge:
Expand Down

0 comments on commit 57fd7ca

Please sign in to comment.