Skip to content

Instantly share code, notes, and snippets.

@mym0404
Created August 29, 2020 10:14
Show Gist options
  • Save mym0404/b1c0fc47bd842fac823e3c5f9c1bf3b4 to your computer and use it in GitHub Desktop.
Save mym0404/b1c0fc47bd842fac823e3c5f9c1bf3b4 to your computer and use it in GitHub Desktop.
async startCommitWorkflow({ base64, author, skipTest }: { base64: string; author: string; skipTest: boolean }) {
await axios.post(
'https://api.github.com/repos/{{owner}}/{{repository}}/actions/workflows/string-modification.yml/dispatches',
{
ref: 'master',
inputs: {
values: base64,
author: author || 'Bot',
skipTest: skipTest ? 'true' : 'false',
},
},
{
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: 'token ' + process.env.GITHUB_TOKEN,
},
validateStatus: (status) => status === 204,
},
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment