-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Github Action that will use node-core-utils and create a reliability report at every UTC midnight. PR-URL: #24 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Ben Coe <bencoe@gmail.com>
- Loading branch information
Showing
1 changed file
with
35 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,35 @@ | ||
# Set those repository secrets | ||
# (https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) | ||
# USER_NAME - GitHub user name | ||
# USER_TOKEN - GitHub access token | ||
# JENKINS_TOKEN - GitHub user Jenkins token | ||
|
||
name: Update CI reliability | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
create-report: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
- run: npm i -g node-core-utils | ||
- run: ncu-config --global set jenkins_token ${{ secrets.JENKINS_TOKEN }} | ||
- run: ncu-config --global set token ${{ secrets.USER_TOKEN }} | ||
- run: ncu-config --global set username ${{ secrets.USER_NAME }} | ||
- run: ncu-ci walk pr --stats=true --markdown $PWD/results.md | ||
- run: | | ||
body=`cat results.md | python -c 'import json,sys; print(json.dumps(sys.stdin.read()))'` | ||
title_date=$(date +%Y-%m-%d) | ||
curl --request POST \ | ||
--url https://api.github.com/repos/${GITHUB_REPOSITORY}/issues \ | ||
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | ||
--header 'content-type: application/json' \ | ||
--data "{ | ||
\"title\": \"CI Reliability ${title_date}\", | ||
\"body\": ${body} | ||
}" |