setup ts file with steps

This commit is contained in:
Naveenraj M
2020-03-29 00:58:20 +05:30
parent 73431f3174
commit 3eecffe906

View File

@ -1,11 +1,37 @@
const core = require('@actions/core'); const core = require('@actions/core');
const github = require('@actions/github'); const github = require('@actions/github');
const exec = require('@actions/exec');
async function run() { async function run() {
try { try {
const myInput = core.getInput('specFile'); const myInput = core.getInput('specFile');
core.debug(`Hello ${myInput} from inside a container`); core.debug(`Hello ${myInput} from inside a container`);
// Get repo files from /github/workspace/
await exec.exec('ls -la /github/workspace');
// LOG: know current directory
await exec.exec('pwd && echo $HOME && ls');
// Copy spec file from path specFile to /root/rpmbuild/SPECS/
// Get tar.gz file of release
// Copy tar.gz file to /root/rpmbuild/SOURCES
// Execute rpmbuild
// Get path for rpm
// setOutput rpm_path to /root/rpmbuild/RPMS , to be consumed by other actions like
// actions/upload-release-asset
// Get github context data // Get github context data
const context = github.context; const context = github.context;
console.log(`We can even get context data, like the repo: ${context.repo.repo}`); console.log(`We can even get context data, like the repo: ${context.repo.repo}`);