Skip to content

Commit 7e85223

Browse files
authored
Merge branch 'devonfw-tutorials:main' into main
2 parents 1a5397e + b473e4f commit 7e85223

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

.github/workflows/syntaxCheckPullRequest.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
- name: Select Changed Files
1919
id: changedfiles
2020
run: node selectChangedFiles.js
21-
- name: Get branch
22-
id: get_branch
23-
run: node getHeadRef.js
21+
- name: Get Playbook Checkout
22+
id: get_checkout
23+
run: node getPlaybookCheckout.js
2424
- name: Setup matrix combinations
2525
id: setup-matrix-combinations
2626
run: |
@@ -35,7 +35,8 @@ jobs:
3535
echo ::set-output name=matrix-combinations::{\"include\":[$MATRIX_PARAMS_COMBINATIONS]}
3636
outputs:
3737
matrix-combinations: ${{ steps.setup-matrix-combinations.outputs.matrix-combinations }}
38-
head_ref: ${{ steps.get_branch.outputs.head_ref}}
38+
checkout_ref: ${{ steps.get_checkout.outputs.ref}}
39+
checkout_name: ${{ steps.get_checkout.outputs.name}}
3940

4041
build:
4142
runs-on: ubuntu-latest
@@ -50,16 +51,16 @@ jobs:
5051
- name: Checkout playbooks
5152
uses: actions/checkout@v2
5253
with:
53-
repository: devonfw-tutorials/tutorials
54-
ref: ${{needs.setup-matrix.outputs.head_ref}}
54+
repository: ${{needs.setup-matrix.output.checkout_name}}/tutorials
55+
ref: ${{needs.setup-matrix.outputs.checkout_ref}}
5556
path: playbooks
5657
- uses: actions/setup-node@v2-beta
5758
- name: install TS
5859
run: npm install typescript
5960
- name: npm install
6061
run: npm install
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
62+
- name: run buildRun.sh --user ${{ github.actor }} --branch ${{needs.setup-matrix.outputs.checkout_ref}} --checkSyntax
63+
run: sh buildRun.sh --user ${{ github.actor }} --branch ${{needs.setup-matrix.outputs.checkout_ref}} --checkSyntax -p ${{ matrix.tutorial }} -e test_console
6364
- name: Check error file existence
6465
id: check_files
6566
uses: andstor/file-existence-action@v1

getHeadRef.js renamed to getPlaybookCheckout.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,27 @@ const core = require("@actions/core");
22
const { Octokit } = require("@octokit/core");
33
const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
44

5-
async function getHeadRef() {
5+
async function getPlaybookCheckout() {
66
let pr = process.env.PR_NUMBER;
7-
let ref ="";
7+
let head = "";
88
try {
99
let get = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', {
1010
owner: 'devonfw-tutorials',
1111
repo: 'tutorials',
1212
pull_number: pr
1313
});
14-
ref = get.data.head.ref;
14+
head = get.data.head;
1515
} catch(e) {
1616
throw e;
1717
}
18-
core.info(`Head Ref: ${ref}`);
19-
core.setOutput('head_ref', ref);
18+
core.info(`ref: ${head.ref}`);
19+
core.setOutput('ref', head.ref);
20+
core.info(`name : ${head.user.login}`);
21+
core.setOutput('name', head.user.login);
22+
2023
}
2124

22-
getHeadRef().catch(err => {
25+
getPlaybookCheckout().catch(err => {
2326
console.log(err);
2427
process.exit(1);
2528
});

0 commit comments

Comments
 (0)