Skip to content

Commit

Permalink
Removing dual use of workflow from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-uk committed Aug 9, 2020
1 parent 64b7a44 commit 228ff68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ jobs:
workflow: Message Echo 2
token: ${{ secrets.PERSONAL_TOKEN }}

- name: Invoke echo 1 workflow by id
uses: ./
with:
workflow: '1854247'
token: ${{ secrets.PERSONAL_TOKEN }}
inputs: '{"message": "Mango jam"}'

- name: Update repo with build
uses: mikeal/publish-to-github-action@master
env:
Expand Down
8 changes: 6 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,13 +545,13 @@ function run() {
try {
// Required inputs
const token = core.getInput('token');
const workflowReference = core.getInput('workflow');
const workflowName = core.getInput('workflow');
// Optional inputs, with defaults
const ref = core.getInput('ref') || github.context.ref;
const [owner, repo] = core.getInput('repo')
? core.getInput('repo').split('/')
: [github.context.repo.owner, github.context.repo.repo];
// Decode inputs, these MUST be a valid JSON string
// Decode inputs, this MUST be a valid JSON string
let inputs = {};
const inputsJson = core.getInput('inputs');
if (inputsJson) {
Expand All @@ -561,6 +561,10 @@ function run() {
const octokit = github.getOctokit(token);
// List workflows via API
const workflows = yield octokit.paginate(octokit.actions.listRepoWorkflows.endpoint.merge({ owner, repo, ref, inputs }));
// Debug response if ACTIONS_STEP_DEBUG is enabled
core.debug('### START List Workflows response data');
core.debug(JSON.stringify(workflows, null, 3));
core.debug('### END: List Workflows response data');
// Locate workflow by name as we need it's id
const workflowFind = workflows.find((workflow) => workflow.name === workflowName);
if (!workflowFind)
Expand Down

0 comments on commit 228ff68

Please sign in to comment.