-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push to Roadie DS on every PR (#136)
* Add workflow files * Remove someting * Different request lib * improvements * Send * in file * Send to Roadie * Quote curl * Verbose * Use correct secret * Replce newlines * Fix json * Update steps * remove payload
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
name: Record executed workflow steps in Roadie | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
send_actions_to_roadie: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
CI: true | ||
NODE_ENV: test | ||
|
||
steps: | ||
- name: Log node version | ||
run: node --version | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
|
||
- 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/* | cut -c 7- | 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" }] }] } | ||
EOF | ||
- name: Output file | ||
run: cat payload.json | ||
|
||
- name: List of actions | ||
run: "curl -vvv -d @payload.json -H 'Content-Type:application/json' -H 'Authorization: bearer ${{ secrets.ROADIE_DEMO2_API_KEY }}' -X POST https://api.roadie.so/api/tech-insights/v1/facts/9de42668-7c6a-4512-893a-b4b2f257944e" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
name: Run tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_and_test: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
CI: true | ||
NODE_ENV: test | ||
|
||
steps: | ||
- name: Log node version | ||
run: node --version | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Lint | ||
run: yarn lint |