diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/action.yml b/action.yml index e7868f4..c3ca1f9 100644 --- a/action.yml +++ b/action.yml @@ -2,6 +2,10 @@ name: Setup composer description: Install and cache composer dependencies author: Jamie Schouten inputs: + working-directory: + description: 'directory to run composer in' + required: false + default: './' args: description: 'install arguments' required: false @@ -21,13 +25,18 @@ runs: - name: Checkout uses: actions/checkout@v4 + - name: Set working directory + run: cd ${{ inputs.working-directory }} + - name: Auth registry run: composer config --global bearer.packistry.qlic.nl ${{ inputs.packistry-token }} + working-directory: ${{ inputs.working-directory }} - name: Get Composer Cache Directory id: composer-cache run: | echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + working-directory: ${{ inputs.working-directory }} - uses: actions/cache@v4 with: @@ -35,6 +44,8 @@ runs: key: ${{ runner.os }}-composer-${{ hashFiles(inputs.file) }} restore-keys: | ${{ runner.os }}-composer- + working-directory: ${{ inputs.working-directory }} - name: Install dependencies run: composer install ${{ inputs.args }} + working-directory: ${{ inputs.working-directory }}