Skip to content

Commit

Permalink
Merge pull request #215 from Tradeshift/working-dir
Browse files Browse the repository at this point in the history
INFRASEC-1265 Add working_directory option
  • Loading branch information
Fardin Khanjani authored Jul 13, 2023
2 parents 04cd015 + 81cd905 commit 609d000
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
.idea
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ steps:
with:
registry: https://npm.pkg.github.com/
npm_publish: true
working_directory: ./subdir
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ inputs:
check_name:
required: false
description: 'Will post changelog under this check name if set. Useful w/ dry_run / PRs.'
working_directory:
required: false
description: 'Specify another working directory for semantic release. Default one is provided by github.'
outputs:
new_release_published:
description: 'Whether a new release was published'
Expand Down
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ const release = async () => {
process.env.GITHUB_EVENT_NAME = "totally-not-a-pr";
process.env.GITHUB_REF = "master";
}
if (core.getInput(inputs.working_directory)) {
process.chdir(core.getInput(inputs.working_directory));
}
const npmPublish = core.getInput(inputs.npm_publish) === "true";
const registry =
core.getInput(inputs.registry) || "https://registry.npmjs.com/";
Expand Down
1 change: 1 addition & 0 deletions src/inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export default {
registry: "registry",
npm_publish: "npm_publish",
check_name: "check_name",
working_directory: "working_directory"
};

0 comments on commit 609d000

Please sign in to comment.