File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66jobs :
77 setup-matrix :
88 runs-on : ubuntu-latest
9+ env :
10+ PR_NUMBER : ${{github.event.number}}
11+
912 steps :
1013 - name : Checkout playbooks
1114 uses : actions/checkout@v2
12- with :
13- repository : devonfw-tutorials/tutorials
14- path : playbooks
15- - id : changedfiles
16- uses : jitterbit/get-changed-files@v1
15+ - name : Install node environment
16+ uses : actions/setup-node@v2-beta
17+ - name : npm install
18+ run : npm install
19+ - name : Select Changed Files
20+ id : changedfiles
21+ run : |
22+ node selectChangedFiles.js
1723 - name : Setup matrix combinations
1824 id : setup-matrix-combinations
1925 run : |
2026 dirs=()
21- for changed_file in ${{ steps.changedfiles.outputs.all }}; do
27+ for changed_file in ${{ steps.changedfiles.outputs.changedFiles }}; do
2228 dir="$(echo $changed_file | cut -d/ -f1)"
2329 if [[ ! " ${dirs[@]} " =~ " ${dir} " ]]; then
2430 MATRIX_PARAMS_COMBINATIONS=$MATRIX_PARAMS_COMBINATIONS'{"tutorial": "'$dir'"},'
5561 run : npm install
5662
5763 - name : run buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request_target.head.ref }} --checkSyntax
58- run : sh buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request_target.head.ref }} --checkSyntax -p ${{ matrix.tutorial }} -e test_console
64+ run : |
65+ sh buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request_target.head.ref }} --checkSyntax -p ${{ matrix.tutorial }} -e test_console
5966
6067 - name : Check error file existence
6168 id : check_files
Original file line number Diff line number Diff line change 44 "description" : " " ,
55 "dependencies" : {
66 "pegjs" : " ^0.10.0" ,
7- "rimraf" : " ^3.0.2"
7+ "rimraf" : " ^3.0.2" ,
8+ "@octokit/core" : " ^3.2.3" ,
9+ "@actions/core" : " ^1.2.2"
810 },
911 "author" : " " ,
1012 "license" : " ISC"
Original file line number Diff line number Diff line change 1+ const core = require ( "@actions/core" ) ;
2+ const { Octokit } = require ( "@octokit/core" ) ;
3+ const octokit = new Octokit ( { auth : process . env . GITHUB_TOKEN } ) ;
4+
5+ async function selectChangedFiles ( ) {
6+ let pr = process . env . PR_NUMBER ;
7+ let arr = [ ] ;
8+ try {
9+ let get = await octokit . request ( 'GET /repos/{owner}/{repo}/pulls/{pull_number}/files' , {
10+ owner : 'devonfw-tutorials' ,
11+ repo : 'tutorials' ,
12+ pull_number : pr
13+ } ) ;
14+ let files = get . data ;
15+ files . forEach ( file => {
16+ arr . push ( file . filename )
17+ } ) ;
18+ } catch ( e ) {
19+ throw e ;
20+ }
21+ let output = arr . join ( ' ' ) ;
22+ core . info ( `Changed Files: ${ output } ` ) ;
23+ core . setOutput ( 'changedFiles' , output ) ;
24+ }
25+
26+ selectChangedFiles ( ) . catch ( err => {
27+ console . log ( err ) ;
28+ process . exit ( 1 ) ;
29+ } ) ;
30+
You can’t perform that action at this time.
0 commit comments