|
6 | 6 |
|
7 | 7 | name: Update CI reliability |
8 | 8 |
|
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + |
9 | 12 | on: |
10 | 13 | schedule: |
11 | 14 | - cron: '0 0 * * *' |
12 | 15 | workflow_dispatch: |
13 | 16 |
|
14 | 17 | jobs: |
15 | 18 | create-report: |
| 19 | + name: Create and update the report |
16 | 20 | runs-on: ubuntu-latest |
17 | 21 | steps: |
18 | | - - uses: actions/setup-node@v4 |
19 | | - with: |
20 | | - node-version: lts/* |
21 | | - - run: npm i -g @node-core/utils |
22 | | - - run: ncu-config --global set jenkins_token ${{ secrets.JENKINS_TOKEN }} |
23 | | - - run: ncu-config --global set token ${{ secrets.USER_TOKEN }} |
24 | | - - run: ncu-config --global set username ${{ secrets.USER_NAME }} |
25 | | - - run: ncu-ci walk pr --stats=true --markdown $PWD/results.md |
26 | | - - run: cat $PWD/results.md >> $GITHUB_STEP_SUMMARY |
27 | | - - run: | |
28 | | - title_date=$(date +%Y-%m-%d) |
29 | | - echo "{ \"title\": \"CI Reliability ${title_date}\", \"body\": " >> body.json |
30 | | - cat results.md | python -c 'import json,sys; print(json.dumps(sys.stdin.read()))' >> body.json |
31 | | - echo "}" >> body.json |
32 | | - curl --request POST \ |
33 | | - --url https://api.github.com/repos/${GITHUB_REPOSITORY}/issues \ |
34 | | - --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ |
35 | | - --header 'content-type: application/json' \ |
36 | | - --data @body.json |
| 22 | + - name: Clone reliability |
| 23 | + uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + path: reliability |
| 26 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 27 | + |
| 28 | + - name: Install Node.js |
| 29 | + uses: actions/setup-node@v4 |
| 30 | + with: |
| 31 | + node-version: lts/* |
| 32 | + |
| 33 | + - name: Install @node-core/utils |
| 34 | + run: npm install -g @node-core/utils |
| 35 | + |
| 36 | + - name: Configure @node-core/utils |
| 37 | + run: | |
| 38 | + ncu-config --global set jenkins_token ${{ secrets.JENKINS_TOKEN }} |
| 39 | + ncu-config --global set token ${{ secrets.USER_TOKEN }} |
| 40 | + ncu-config --global set username ${{ secrets.USER_NAME }} |
| 41 | +
|
| 42 | + - name: Generate reports |
| 43 | + run: | |
| 44 | + cd reliability |
| 45 | + ./generate-report.sh |
| 46 | + cat ./progress.md >> $GITHUB_STEP_SUMMARY |
| 47 | + cat ./reports/$(date +%Y-%m-%d).md >> $GITHUB_STEP_SUMMARY |
| 48 | +
|
| 49 | + - name: Create issue |
| 50 | + run: | |
| 51 | + title_date=$(date +%Y-%m-%d) |
| 52 | + echo "{ \"title\": \"CI Reliability ${title_date}\", \"body\": " >> body.json |
| 53 | + cat reliability/progress.md | python -c 'import json,sys; print(json.dumps(sys.stdin.read()))' >> body.json |
| 54 | + echo "}" >> body.json |
| 55 | + curl --request POST \ |
| 56 | + --url https://api.github.com/repos/${GITHUB_REPOSITORY}/issues \ |
| 57 | + --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ |
| 58 | + --header 'content-type: application/json' \ |
| 59 | + --data @body.json |
0 commit comments