Skip to content

Commit

Permalink
fix: secrets must be inputs (#13)
Browse files Browse the repository at this point in the history
* fix: secrets must be inputs

* chore: changing runner
  • Loading branch information
lzecca78 authored Jan 3, 2025
1 parent 6fea514 commit a883318
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .github/actions/erlang-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ on:
type: string
default: .
description: "Elixir Mix project directory"
GHA_SSH_DEPLOY_KEY:
description: "SSH private key for deployment"
required: false
HEX_KEY:
description: "API Key for hex package publish on hex.pm"
required: false
Expand All @@ -54,7 +57,7 @@ jobs:
# perform secret check & put boolean result as an output
shell: bash
run: |
if [ "${{ secrets.GHA_SSH_DEPLOY_KEY }}" != '' ]; then
if [ "${{ inputs.GHA_SSH_DEPLOY_KEY }}" != '' ]; then
echo "gha_ssh_deploy_key_available=true" >> $GITHUB_OUTPUT;
else
echo "gha_ssh_deploy_key_available=false" >> $GITHUB_OUTPUT;
Expand Down Expand Up @@ -95,12 +98,12 @@ jobs:
with:
ssh-private-key: ${{ secrets.GHA_SSH_DEPLOY_KEY }}
- name: Login to hex.pm
run: rebar3 hex organization auth prima --key ${{ secrets.HEX_KEY }}
run: rebar3 hex organization auth prima --key ${{ inputs.HEX_KEY }}
- name: Install dependencies
run: rebar3 update; rebar3 deps
- name: Publish to Hex.pm
run: rebar3 hex publish -r hexpm:${{ inputs.hex-organization }}
env:
HEX_API_KEY: ${{ secrets.HEX_KEY }}
HEX_API_KEY: ${{ inputs.HEX_KEY }}
needs:
- secrets_check
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ on:

jobs:
erlang-publish:
runs-on: k8s-medium
runs-on: ubuntu-latest
steps:
- name: "Publish to Hex"
uses: ./.github/actions/erlang-publish
with:
runs-on: ubuntu-latest
rebar3-version: 3.24.0
otp-version: 26.0
HEX_KEY: ${{ secrets.HEX_KEY }}

0 comments on commit a883318

Please sign in to comment.