Skip to content

Commit a58d025

Browse files
Add config-script input
``` - uses: CargoSense/setup-elixir-project@v1 with: config-script: | mix hex.repo add oban https://repo.oban.pro --fetch-public-key "${{ secrets.OBAN_KEY_FINGERPRINT }}" --auth-key "${{ secrets.OBAN_LICENSE_KEY }}" ```
1 parent 9dc8c8a commit a58d025

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ jobs:
3434
with:
3535
elixir-version: 1.15
3636
otp-version: 25
37+
config-script: |
38+
echo "hello, world" > hello.txt
3739
- name: Check Erlang and Elixir versions
3840
run: |
3941
elixir --version | grep 'Erlang/OTP 25'
4042
elixir --version | grep 'Elixir 1.15'
43+
grep -q "hello, world" hello.txt

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
# invalidate existing caches.
2424
# Default: "v1"
2525
cache-key: ""
26+
# An optional Bash script to run before fetching and compiling dependencies.
27+
# May be used to configure Mix or Rebar3.
28+
config-script: ""
2629
# Compile application using `mix compile`.
2730
# Default: true
2831
build-app: true

action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ inputs:
2020
An arbitrary string added to the derived cache key names. Set or change to
2121
invalidate existing caches.
2222
default: "v1"
23+
config-script:
24+
description: >-
25+
An optional Bash script to run before fetching and compiling dependencies.
26+
May be used to configure Mix or Rebar3.
2327
build-app:
2428
description: Compile application using `mix compile`.
2529
default: true
@@ -116,6 +120,13 @@ runs:
116120
run: mix local.rebar --force
117121
shell: bash
118122

123+
- name: Run configuration script
124+
if: inputs.config-script != ''
125+
run: /bin/bash -c "${CONFIG_SCRIPT}"
126+
shell: bash
127+
env:
128+
CONFIG_SCRIPT: ${{ inputs.config-script }}
129+
119130
- name: Get out-of-date project dependencies
120131
run: mix deps.get
121132
shell: bash

0 commit comments

Comments
 (0)