-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
41 lines (29 loc) · 904 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const core = require('@actions/core');
const github = require('@actions/github');
const exec = require('@actions/exec');
const shell = require('shelljs');
const fs = require('fs')
async function run() {
try {
const dateTime = (new Date()).toLocaleString('pt-BR');
const path = core.getInput('path');
if (!fs.existsSync(path)) {
throw new Error('Path not found');
}
const {
ref,
eventName
} = github.context;
const {
repository
} = github.context.payload
shell.echo(`💡 Job started at ${dateTime}`);
shell.echo(`🖥️ Job was automatically triggered by ${eventName} event`);
shell.echo(`🔎 The name of your branch is ${ref} and your repository is ${repository.name}.`)
shell.echo(process.env);
shell.echo(`🎉 Job has been finished`);
} catch (error) {
core.setFailed(error.message);
}
}
run();