From b8cb6e6f5b27758bbfd1729351599ecc7fc3195c Mon Sep 17 00:00:00 2001 From: KeHaoKH Date: Wed, 29 Jun 2022 01:28:25 +0800 Subject: [PATCH 1/8] ci: use env var with secrets Signed-off-by: KeHaoKH --- .github/workflows/license-scan.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/license-scan.yml b/.github/workflows/license-scan.yml index e337e3034..0afa73f35 100644 --- a/.github/workflows/license-scan.yml +++ b/.github/workflows/license-scan.yml @@ -1,6 +1,11 @@ name: license check by FOSS on: [pull_request] +env: + # DO NOT use the GITHUB_TOKEN here + # see https://github.com/devstream-io/devstream/pull/414 for more info + FOSSA-API-KEY: ${{ secrets.${{ FOSSA_PUSH_ONLY_API_KEY }} }} + jobs: fossa: runs-on: ubuntu-latest @@ -11,4 +16,4 @@ jobs: - uses: fossa-contrib/fossa-action@v1 with: # https://docs.fossa.com/docs/api-reference#push-only-api-token - fossa-api-key: c03fe407c7aa56b90b7dac1ae1868dd0 + fossa-api-key: ${{ env.FOSSA-API-KEY }} From 987a6cfd7f13edcbfcef9f32561d811608871876 Mon Sep 17 00:00:00 2001 From: KeHaoKH Date: Wed, 29 Jun 2022 01:33:53 +0800 Subject: [PATCH 2/8] ci: fix syntax error Signed-off-by: KeHaoKH --- .github/workflows/license-scan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/license-scan.yml b/.github/workflows/license-scan.yml index 0afa73f35..2952ed0a8 100644 --- a/.github/workflows/license-scan.yml +++ b/.github/workflows/license-scan.yml @@ -4,7 +4,7 @@ on: [pull_request] env: # DO NOT use the GITHUB_TOKEN here # see https://github.com/devstream-io/devstream/pull/414 for more info - FOSSA-API-KEY: ${{ secrets.${{ FOSSA_PUSH_ONLY_API_KEY }} }} + FOSSA-API-KEY: ${{ secrets.FOSSA_PUSH_ONLY_API_KEY }} jobs: fossa: From 829e03ea7947a1ffadab86fa4ab2b0c718fbb41f Mon Sep 17 00:00:00 2001 From: KeHaoKH Date: Wed, 29 Jun 2022 01:52:01 +0800 Subject: [PATCH 3/8] ci: use pull_request_target Signed-off-by: KeHaoKH --- .github/workflows/license-scan.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/license-scan.yml b/.github/workflows/license-scan.yml index 2952ed0a8..972dbe5ff 100644 --- a/.github/workflows/license-scan.yml +++ b/.github/workflows/license-scan.yml @@ -1,10 +1,6 @@ name: license check by FOSS -on: [pull_request] - -env: - # DO NOT use the GITHUB_TOKEN here - # see https://github.com/devstream-io/devstream/pull/414 for more info - FOSSA-API-KEY: ${{ secrets.FOSSA_PUSH_ONLY_API_KEY }} +on: + pull_request_target jobs: fossa: @@ -16,4 +12,4 @@ jobs: - uses: fossa-contrib/fossa-action@v1 with: # https://docs.fossa.com/docs/api-reference#push-only-api-token - fossa-api-key: ${{ env.FOSSA-API-KEY }} + fossa-api-key: ${{ secrets.FOSSA_PUSH_ONLY_API_KEY }} From 532c659b896ef922eaca87f81c804c9e2ddde4c4 Mon Sep 17 00:00:00 2001 From: KeHaoKH Date: Wed, 29 Jun 2022 02:11:29 +0800 Subject: [PATCH 4/8] ci: use env and test Signed-off-by: KeHaoKH --- .github/workflows/license-scan.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/license-scan.yml b/.github/workflows/license-scan.yml index 972dbe5ff..70894799d 100644 --- a/.github/workflows/license-scan.yml +++ b/.github/workflows/license-scan.yml @@ -5,11 +5,14 @@ on: jobs: fossa: runs-on: ubuntu-latest + env: + SECRETS_FOSSA_API_KEY: ${{ secrets.FOSSA_PUSH_ONLY_API_KEY }} steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - uses: fossa-contrib/fossa-action@v1 + run: echo ${{ env.SECRETS_FOSSA_API_KEY }} with: # https://docs.fossa.com/docs/api-reference#push-only-api-token - fossa-api-key: ${{ secrets.FOSSA_PUSH_ONLY_API_KEY }} + fossa-api-key: ${{ env.SECRETS_FOSSA_API_KEY }} From 4f00b152032bf000f5753c780e67582a5af8c031 Mon Sep 17 00:00:00 2001 From: KeHaoKH Date: Wed, 29 Jun 2022 02:14:32 +0800 Subject: [PATCH 5/8] ci: use env and test on pull request Signed-off-by: KeHaoKH --- .github/workflows/license-scan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/license-scan.yml b/.github/workflows/license-scan.yml index 70894799d..11de1e7da 100644 --- a/.github/workflows/license-scan.yml +++ b/.github/workflows/license-scan.yml @@ -1,6 +1,6 @@ name: license check by FOSS on: - pull_request_target + pull_request jobs: fossa: From 7956cc83e6aa3b2ea68373f333b241802bd65d6d Mon Sep 17 00:00:00 2001 From: KeHaoKH Date: Wed, 29 Jun 2022 02:19:03 +0800 Subject: [PATCH 6/8] ci: use env with fossa Signed-off-by: KeHaoKH --- .github/workflows/license-scan.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/license-scan.yml b/.github/workflows/license-scan.yml index 11de1e7da..3d48b2759 100644 --- a/.github/workflows/license-scan.yml +++ b/.github/workflows/license-scan.yml @@ -12,7 +12,6 @@ jobs: with: fetch-depth: 0 - uses: fossa-contrib/fossa-action@v1 - run: echo ${{ env.SECRETS_FOSSA_API_KEY }} with: # https://docs.fossa.com/docs/api-reference#push-only-api-token fossa-api-key: ${{ env.SECRETS_FOSSA_API_KEY }} From 986b3c8488f1b6b7f0ec323b72a4f85b02cfd26e Mon Sep 17 00:00:00 2001 From: KeHaoKH Date: Wed, 29 Jun 2022 11:36:43 +0800 Subject: [PATCH 7/8] ci: fix spaces indent Signed-off-by: KeHaoKH --- .github/workflows/license-scan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/license-scan.yml b/.github/workflows/license-scan.yml index 3d48b2759..49674bcb3 100644 --- a/.github/workflows/license-scan.yml +++ b/.github/workflows/license-scan.yml @@ -14,4 +14,4 @@ jobs: - uses: fossa-contrib/fossa-action@v1 with: # https://docs.fossa.com/docs/api-reference#push-only-api-token - fossa-api-key: ${{ env.SECRETS_FOSSA_API_KEY }} + fossa-api-key: ${{ env.SECRETS_FOSSA_API_KEY }} From 9278f660e361763576a2ef0b211afd5b8a1bf548 Mon Sep 17 00:00:00 2001 From: KeHaoKH Date: Wed, 29 Jun 2022 11:43:33 +0800 Subject: [PATCH 8/8] ci: use fossa key can only be pushed to fossa Signed-off-by: KeHaoKH --- .github/workflows/license-scan.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/license-scan.yml b/.github/workflows/license-scan.yml index 49674bcb3..1f3f69113 100644 --- a/.github/workflows/license-scan.yml +++ b/.github/workflows/license-scan.yml @@ -5,8 +5,6 @@ on: jobs: fossa: runs-on: ubuntu-latest - env: - SECRETS_FOSSA_API_KEY: ${{ secrets.FOSSA_PUSH_ONLY_API_KEY }} steps: - uses: actions/checkout@v2 with: @@ -14,4 +12,4 @@ jobs: - uses: fossa-contrib/fossa-action@v1 with: # https://docs.fossa.com/docs/api-reference#push-only-api-token - fossa-api-key: ${{ env.SECRETS_FOSSA_API_KEY }} + fossa-api-key: 047e53daaa907de4fda24866d0346f1d