Skip to content

Commit

Permalink
Allow user to change working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlawson committed May 18, 2024
1 parent 75c00d8 commit 60b1616
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ jobs:
serverless-version: 3
```
## Change your working directory
```yaml
- name: Deploy with a particular version
uses: serverless/[email protected]
with:
working-directory: ./foo
```
## Usage with serverless plugins
Change your action in this way, according to [this issue](https://github.com/serverless/github-action/issues/28), thanks to @matthewpoer:
```yaml
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ inputs:
description: 'Version of the Serverless Framework to use (default: latest)'
required: false
default: latest
working-directory:
description: 'Folder where your configuration is located'
required: false
default: .
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.working-directory }}
- ${{ inputs.serverless-version }}
- ${{ inputs.args }}
5 changes: 3 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh -l
npm i -g serverless@${1/v/}
serverless $2
cd $1
npm i -g serverless@${2/v/}
serverless $3

0 comments on commit 60b1616

Please sign in to comment.