Skip to content

Commit

Permalink
ci: mask manually entered Dash Token
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Sep 4, 2024
1 parent 30a64f4 commit d1faa79
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/licensecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
inputs:
dash-iplab-token:
description: "Gitlab Personal Access Token (https://gitlab.eclipse.org/-/profile/personal_access_tokens) with 'api'' scope for Automatic IP Team Review Requests via org.eclipse.dash:license-tool-plugin, see https://github.com/eclipse/dash-licenses#automatic-ip-team-review-requests"
description: "Gitlab Personal Access Token (https://gitlab.eclipse.org/-/user_settings/personal_access_tokens) with 'api'' scope for Automatic IP Team Review Requests via org.eclipse.dash:license-tool-plugin, see https://github.com/eclipse/dash-licenses#automatic-ip-team-review-requests"
default: ""
type: string

Expand All @@ -35,6 +35,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Mask Dash IP Token
if: ${{ inputs.dash-iplab-token != '' }}
run: |
DASH_IPLAB_TOKEN=$(jq -r '.inputs.dash-iplab-token' $GITHUB_EVENT_PATH)
DASH_IPLAB_TOKEN=$(echo "$DASH_IPLAB_TOKEN" | xargs) # trim string
echo "::add-mask::$DASH_IPLAB_TOKEN"
echo "DASH_IPLAB_TOKEN=$DASH_IPLAB_TOKEN" >> $GITHUB_ENV
- name: "Show: GitHub context"
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
Expand Down Expand Up @@ -86,8 +95,6 @@ jobs:


- name: Dash License check # see https://github.com/eclipse/dash-licenses
env:
DASH_IPLAB_TOKEN: "${{ inputs.dash-iplab-token }}"
run: |
set -eu
Expand All @@ -108,7 +115,7 @@ jobs:
maven_args="--no-transfer-progress"
fi
if [[ -n $DASH_IPLAB_TOKEN ]]; then
if [[ -n ${DASH_IPLAB_TOKEN:-} ]]; then
dash_iplab_token_arg="-Ddash.iplab.token=$DASH_IPLAB_TOKEN"
fi
Expand Down

0 comments on commit d1faa79

Please sign in to comment.