Skip to content

Commit 1a5397e

Browse files
author
dixyushi
committed
Merge remote-tracking branch 'upstream/main' into main
2 parents f603c14 + 0e035ef commit 1a5397e

4 files changed

Lines changed: 41 additions & 19 deletions

File tree

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
name: Check PR Katacoda Syntax
2-
2+
env:
3+
PR_NUMBER: ${{github.event.number}}
34
on:
45
pull_request_target:
56
branches: [ main ]
67
jobs:
78
setup-matrix:
89
runs-on: ubuntu-latest
9-
env:
10-
PR_NUMBER: ${{github.event.number}}
1110

1211
steps:
1312
- name: Checkout playbooks
@@ -18,8 +17,10 @@ jobs:
1817
run: npm install
1918
- name: Select Changed Files
2019
id: changedfiles
21-
run: |
22-
node selectChangedFiles.js
20+
run: node selectChangedFiles.js
21+
- name: Get branch
22+
id: get_branch
23+
run: node getHeadRef.js
2324
- name: Setup matrix combinations
2425
id: setup-matrix-combinations
2526
run: |
@@ -34,6 +35,7 @@ jobs:
3435
echo ::set-output name=matrix-combinations::{\"include\":[$MATRIX_PARAMS_COMBINATIONS]}
3536
outputs:
3637
matrix-combinations: ${{ steps.setup-matrix-combinations.outputs.matrix-combinations }}
38+
head_ref: ${{ steps.get_branch.outputs.head_ref}}
3739

3840
build:
3941
runs-on: ubuntu-latest
@@ -45,31 +47,24 @@ jobs:
4547
uses: actions/checkout@v2
4648
with:
4749
repository: devonfw-tutorials/tutorial-compiler
48-
4950
- name: Checkout playbooks
5051
uses: actions/checkout@v2
5152
with:
5253
repository: devonfw-tutorials/tutorials
54+
ref: ${{needs.setup-matrix.outputs.head_ref}}
5355
path: playbooks
54-
5556
- uses: actions/setup-node@v2-beta
56-
5757
- name: install TS
5858
run: npm install typescript
59-
6059
- name: npm install
6160
run: npm install
62-
63-
- name: run buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request_target.head.ref }} --checkSyntax
64-
run: |
65-
sh buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request_target.head.ref }} --checkSyntax -p ${{ matrix.tutorial }} -e test_console
66-
61+
- name: run buildRun.sh --user ${{ github.actor }} --branch ${{needs.setup-matrix.outputs.head_ref}} --checkSyntax
62+
run: sh buildRun.sh --user ${{ github.actor }} --branch ${{needs.setup-matrix.outputs.head_ref}} --checkSyntax -p ${{ matrix.tutorial }} -e test_console
6763
- name: Check error file existence
6864
id: check_files
6965
uses: andstor/file-existence-action@v1
7066
with:
7167
files: "./build/errors/syntaxErrors.md"
72-
7368
- name: Get message
7469
id: get_message
7570
if: steps.check_files.outputs.files_exists == 'true'
@@ -80,11 +75,10 @@ jobs:
8075
message="${message//$'\r'/'%0D'}"
8176
echo "${message}"
8277
echo "::set-output name=message::$message"
83-
8478
- name: Request changes
8579
if: ${{ steps.get_message.outputs.message != '' }}
8680
uses: andrewmusgrave/automatic-pull-request-review@0.0.2
8781
with:
8882
repo-token: '${{ secrets.GITHUB_TOKEN }}'
8983
event: COMMENT
90-
body: ${{ steps.get_message.outputs.message }}
84+
body: ${{ steps.get_message.outputs.message }}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
The applciation you see here is a clone of devon4ng-application-template. You can find it here [here](https://github.com/devonfw/devon4ng-application-template)
1+
The application you see here is a clone of devon4ng-application-template. You can find it [here](https://github.com/devonfw/devon4ng-application-template)
22

3-
The `SampleDataModule` is a nice exmple of the different layers explained. It holds some components (representing the *components* layer) and also has a `SampleDataService` (representing the *service* layer) which is imported in the required components.
3+
The `SampleDataModule` is a nice example of the different layers explained. It holds some components (representing the *components* layer) and also has a `SampleDataService` (representing the *service* layer) which is imported in the required components.
44

55
The service acts as the adapter element explained earlier (used to make XHR calls).

devon4ng-architecture/index.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,6 @@ To conclude, in this tutorial you learned
6868
* the different types of modules - core, shared and feature
6969
7070
Then we referred a devon4ng application by cloning it and traversing through its files. You can study in more detail about Angular architecture by following [this document](https://devonfw.com/website/pages/docs/master-devon4ng.asciidoc_architecture.html#meta-architecture.asciidoc_devonfw-reference-client-architecture).
71+
72+
The idea with devon4ng is to define an architecture which is a compromise between, on the one hand, leveraging the best practices and latest trends like reactive style development, on the other hand, providing a short onboarding time while still using an architecture that helps us scale and be productive at the same time.
7173
====

getHeadRef.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 getHeadRef() {
6+
let pr = process.env.PR_NUMBER;
7+
let ref ="";
8+
try {
9+
let get = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', {
10+
owner: 'devonfw-tutorials',
11+
repo: 'tutorials',
12+
pull_number: pr
13+
});
14+
ref = get.data.head.ref;
15+
} catch(e) {
16+
throw e;
17+
}
18+
core.info(`Head Ref: ${ref}`);
19+
core.setOutput('head_ref', ref);
20+
}
21+
22+
getHeadRef().catch(err => {
23+
console.log(err);
24+
process.exit(1);
25+
});
26+

0 commit comments

Comments
 (0)