Skip to content

Commit

Permalink
Replce newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
dtuite committed Jul 10, 2024
1 parent 613ad35 commit 93806c2
Show file tree
Hide file tree
Showing 4 changed files with 698 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/roadie-workflow-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
- name: Write json to file
run: |
date=$(date +"%Y-%m-%dT%H:%M:%S%z")
string_list_of_actions=$(grep --ignore-case --no-filename -Po 'uses:\s([\w\/\@\-\.]+)' .github/workflows/*)
string_list_of_actions=$(grep --ignore-case --no-filename -Po 'uses:\s([\w\/\@\-\.]+)' .github/workflows/* | tr '\n' ',')
echo "$string_list_of_actions"
cat << EOF > ./payload.json
{ "items": [{ "timestamp": "$date", "entity": "component:default/sample-service", "facts": [{ "id": "6f108369-8e28-4dca-a98d-66e02e7d226a", "value": "$string_list_of_actions" } }] }] }
Expand Down
2 changes: 1 addition & 1 deletion payload.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"commit_id": "2024-07-10T15:10:30+0100" }
{ "items": [{ "timestamp": "2024-07-10T15:25:18+0100", "entity": "component:default/sample-service", "facts": [{ "id": "6f108369-8e28-4dca-a98d-66e02e7d226a", "value": "uses: actions/checkout@v2,uses: github/codeql-action/init@v1,uses: github/codeql-action/autobuild@v1,uses: github/codeql-action/analyze@v1,uses: actions/checkout@v2,uses: actions/setup-node@v1,uses: actions/checkout@v2,uses: actions/setup-node@v2,uses: actions/setup-python@v2,uses: actions/checkout@v3,uses: actions/checkout@v3," } }] }] }
6 changes: 5 additions & 1 deletion script.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
date=$(date +"%Y-%m-%dT%H:%M:%S%z")
string_list_of_actions=$(ggrep --ignore-case --no-filename -Po 'uses:\s([\w\/\@\-\.]+)' .github/workflows/* | tr '\n' ',')

echo "$string_list_of_actions"

cat << EOF > ./payload.json
{"commit_id": "$date" }
{ "items": [{ "timestamp": "$date", "entity": "component:default/sample-service", "facts": [{ "id": "6f108369-8e28-4dca-a98d-66e02e7d226a", "value": "$string_list_of_actions" } }] }] }
EOF
Loading

0 comments on commit 93806c2

Please sign in to comment.