Compare commits
6 Commits
fix/token-
...
feature/di
Author | SHA1 | Date | |
---|---|---|---|
b3853119a0
|
|||
c2cece21dc
|
|||
24ab8f0c99
|
|||
5af82bd052 | |||
4ee00c960b | |||
288c703a0f |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.idea
|
@@ -19,10 +19,10 @@ This action sets up and installs Composer dependencies for PHP projects, with ca
|
||||
- **Default:** `**/composer.lock`
|
||||
- **Description:** Specifies the file to be hashed for the cache key. By default, it uses the `composer.lock` file, which reflects dependency versions.
|
||||
|
||||
- **token** (optional):
|
||||
- **packistry-token** (optional):
|
||||
- **Type:** `string`
|
||||
- **Default:** `pkdt-***`
|
||||
- **Description:** Deploy token to globally authenticate with packistry
|
||||
- **Description:** Deploy token to authenticate with packistry
|
||||
|
||||
## Usage Example
|
||||
|
||||
|
17
action.yml
17
action.yml
@@ -2,15 +2,19 @@ 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
|
||||
default: '--verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader --ignore-platform-reqs'
|
||||
default: '--verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader --ignore-platform-reqs --no-scripts'
|
||||
file:
|
||||
description: 'file to hash for cache key'
|
||||
required: false
|
||||
default: '**/composer.lock'
|
||||
token:
|
||||
packistry-token:
|
||||
description: 'Packistry deploy token'
|
||||
required: false
|
||||
default: ${{ vars.PACKISTRY_DEPLOY_TOKEN }}
|
||||
@@ -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.token }}
|
||||
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 }}
|
||||
|
Reference in New Issue
Block a user