Skip to content

Commit

Permalink
changing order of script args
Browse files Browse the repository at this point in the history
  • Loading branch information
janeklb committed Aug 25, 2023
1 parent f31f710 commit 2b77efd
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
14 changes: 11 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ inputs:
working-directory:
description: "The directory where your repository is located"
default: "."
workflow-id:
description: "The ID of the workflow to track or name of the file name. E.g. ci.yml. Defaults to current workflow"
parse-merge-queue-branch:
description: "Extract merge-base input from merge queue's branch ref (only applies to merge_queue events)"
default: "false"
workflow-id:
description: "The ID of the workflow to track or name of the file name. E.g. ci.yml. Defaults to current workflow"

outputs:
base:
Expand All @@ -40,7 +40,15 @@ runs:
- name: Set base and head SHAs used for nx affected
id: setSHAs
shell: bash
run: node $GITHUB_ACTION_PATH/dist/index.js ${{ github.token }} ${{ inputs.main-branch-name }} ${{ inputs.error-on-no-successful-workflow }} ${{ inputs.last-successful-event }} ${{ inputs.working-directory }} ${{ inputs.workflow-id }} ${{ inputs.parse-merge-queue-branch }}
run: -<
node $GITHUB_ACTION_PATH/dist/index.js
${{ github.token }}
${{ inputs.main-branch-name }}
${{ inputs.error-on-no-successful-workflow }}
${{ inputs.last-successful-event }}
${{ inputs.parse-merge-queue-branch }}
${{ inputs.working-directory }}
${{ inputs.workflow-id }}

- name: Log base and head SHAs used for nx affected
shell: bash
Expand Down
18 changes: 11 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13713,13 +13713,17 @@ const { execSync } = __nccwpck_require__(2081);
const { existsSync } = __nccwpck_require__(7147);

const { runId, repo: { repo, owner }, eventName } = github.context;
process.env.GITHUB_TOKEN = process.argv[2];
const mainBranchName = process.argv[3];
const errorOnNoSuccessfulWorkflow = process.argv[4];
const lastSuccessfulEvent = process.argv[5];
const workingDirectory = process.argv[6];
const workflowId = process.argv[7];
const parseMergeQueue = process.argv[8];

const args = process.argv.slice(2);
process.env.GITHUB_TOKEN = args.shift();

const mainBranchName = args.shift();
const errorOnNoSuccessfulWorkflow = args.shift();
const lastSuccessfulEvent = args.shift();
const parseMergeQueue = args.shift();
const workingDirectory = args.shift();
const workflowId = args.shift();

const defaultWorkingDirectory = '.';

let BASE_SHA;
Expand Down
18 changes: 11 additions & 7 deletions find-successful-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ const { execSync } = require('child_process');
const { existsSync } = require('fs');

const { runId, repo: { repo, owner }, eventName } = github.context;
process.env.GITHUB_TOKEN = process.argv[2];
const mainBranchName = process.argv[3];
const errorOnNoSuccessfulWorkflow = process.argv[4];
const lastSuccessfulEvent = process.argv[5];
const workingDirectory = process.argv[6];
const workflowId = process.argv[7];
const parseMergeQueue = process.argv[8];

const args = process.argv.slice(2);
process.env.GITHUB_TOKEN = args.shift();

const mainBranchName = args.shift();
const errorOnNoSuccessfulWorkflow = args.shift();
const lastSuccessfulEvent = args.shift();
const parseMergeQueue = args.shift();
const workingDirectory = args.shift();
const workflowId = args.shift();

const defaultWorkingDirectory = '.';

let BASE_SHA;
Expand Down

0 comments on commit 2b77efd

Please sign in to comment.