Skip to content

Commit 0b510fb

Browse files
committed
a basic nodejs application
1 parent f6b9d54 commit 0b510fb

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Hello Aman, Congratulations!! Your GitHub Actions Workflow is Automated!");

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "automate-github-actions-using-rest-api",
3+
"version": "1.0.0",
4+
"description": "This is a sample node.js project for which github actions cicd workflow file is automated using the github rest apis",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "node test.js"
8+
},
9+
"keywords": [],
10+
"author": "Aman Chopra",
11+
"license": "ISC"
12+
}

test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { exec } = require('child_process');
2+
3+
exec('node index.js', (error, stdout, stderr) => {
4+
if (error) {
5+
console.error(`Error: ${error.message}`);
6+
return;
7+
}
8+
if (stderr) {
9+
console.error(`stderr: ${stderr}`);
10+
return;
11+
}
12+
console.log(`stdout: ${stdout}`);
13+
});

0 commit comments

Comments
 (0)