Skip to content

Commit

Permalink
fix replacing token
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrizzio-dotCMS committed Sep 11, 2023
1 parent 0d95461 commit 2a077e2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ jobs:
- name: Trigger dot-cli
uses: ./actions/dot-cli
id: dot-cli
with:
pass: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhcGkwM2ZiY2ZjZi04ZDA2LTQ5ZTUtYTUwZC1mYTY1Yzk4NGI4YjQiLCJ4bW9kIjoxNjk0NDY5MTA5MDAwLCJuYmYiOjE2OTQ0NjkxMDksImlzcyI6IjRhZmYwZGZiMDciLCJsYWJlbCI6ImNsaSIsImV4cCI6MTc4OTEwNjQwMSwiaWF0IjoxNjk0NDY5MTA5LCJqdGkiOiIxYmI5YjhjNC1lZTcwLTRiMmYtYjFjNC0wYWY3NTMzNmM0MGQifQ.y6s9pXsMnavzoGD-FkMLpKEXEBIhB8QtP3n5EYFzQF4'
with:
command: 'ct'
sub-command: 'pull'
default-action-arg: 'FileAsset'
Expand Down
6 changes: 1 addition & 5 deletions actions/dot-cli/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
name: 'dot-cli'
description: 'Fire dotCMS cli'
inputs:
pass:
description: 'safe pass'
required: true
command:
description: 'dot-cli command'
required: true
Expand All @@ -27,8 +24,7 @@ outputs:
runs:
using: 'docker'
image: 'Dockerfile'
args: # 'ct pull FileAsset --workspace /github/workspace/'
- ${{ inputs.pass }}
args: # 'ct pull FileAsset --workspace /github/workspace/'
- ${{ inputs.command }}
- ${{ inputs.sub-command }}
- ${{ inputs.default-action-arg }}
Expand Down
2 changes: 1 addition & 1 deletion actions/dot-cli/dot-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
active: true
credentials:
user: "[email protected]"
token: "plchldr"
token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhcGkwM2ZiY2ZjZi04ZDA2LTQ5ZTUtYTUwZC1mYTY1Yzk4NGI4YjQiLCJ4bW9kIjoxNjk0NDY5MTA5MDAwLCJuYmYiOjE2OTQ0NjkxMDksImlzcyI6IjRhZmYwZGZiMDciLCJsYWJlbCI6ImNsaSIsImV4cCI6MTc4OTEwNjQwMSwiaWF0IjoxNjk0NDY5MTA5LCJqdGkiOiIxYmI5YjhjNC1lZTcwLTRiMmYtYjFjNC0wYWY3NTMzNmM0MGQifQ.y6s9pXsMnavzoGD-FkMLpKEXEBIhB8QtP3n5EYFzQF4"
15 changes: 6 additions & 9 deletions actions/dot-cli/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@

ls /dot-cli

echo "config::::"

#proof that we can access the repo from within the script
cat /github/workspace/README.md


tkn="$1"
echo "Safe pass is :: $tkn"
#tkn="$1"
#echo "Safe pass is :: $tkn"

#Replace the safe-pass with the value passed in the docker workflow action
sed -i -e "s/plchldr/$tkn/g" "${DOT_SERVICES_HOME}dot-service.yml"

#sed -i -e "s/plchldr/$tkn/g" "${DOT_SERVICES_HOME}dot-service.yml"

echo "$@"; # will echo all args
shift; # will remove first arg from the "$@"
echo "$@"; # will echo all args except first one
#echo "$@"; # will echo all args
#shift; # will remove first arg from the "$@"
#echo "$@"; # will echo all args except first one

var=$(bash /dot-cli/run-java.sh "$@" )
echo "var: $var"
Expand Down

0 comments on commit 2a077e2

Please sign in to comment.