Add multi platform action source

This commit is contained in:
Peter Evans
2019-09-25 09:14:38 +09:00
parent 39529236f7
commit 8023b7d225
4 changed files with 70 additions and 0 deletions

25
index.js Normal file
View File

@@ -0,0 +1,25 @@
const core = require('@actions/core');
const exec = require('@actions/exec');
const os = require('os');
async function run() {
try {
core.info(`platform: ${os.platform()}`)
core.info(`action directory: ${__dirname}`)
if (os.platform() == 'linux') {
await exec.exec('sudo apt-get install python3-setuptools');
}
await exec.exec(`pip3 install --requirement ${__dirname}/requirements.txt`);
if (os.platform() == 'win32') {
await exec.exec(`python ${__dirname}/create-pull-request.py`);
} else {
await exec.exec(`python3 ${__dirname}/create-pull-request.py`);
}
}
catch (error) {
core.setFailed(error.message);
}
}
run()