Skip to content

Commit 189d15b

Browse files
Merge pull request #8 from ipdata/claude/fix-issue-3Hl6Y
Add HEX_API_KEY validation to publish workflow
2 parents abb39e7 + 846824e commit 189d15b

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,23 @@ jobs:
6060
key: ${{ runner.os }}-otp-27-build-${{ hashFiles('rebar.config') }}
6161
restore-keys: ${{ runner.os }}-otp-27-build-
6262

63+
- name: Check HEX_API_KEY
64+
run: |
65+
if [ -z "$HEX_API_KEY" ]; then
66+
echo "::error::HEX_API_KEY secret is not set. Go to repo Settings > Secrets and variables > Actions and add a HEX_API_KEY secret with a valid hex.pm write key."
67+
exit 1
68+
fi
69+
env:
70+
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
71+
6372
- name: Publish to Hex.pm
6473
run: rebar3 hex publish --yes
6574
env:
6675
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
6776

68-
- name: Generate docs
69-
run: rebar3 ex_doc
70-
71-
- name: Publish docs
72-
run: rebar3 hex docs publish --yes
77+
- name: Generate and publish docs
78+
run: |
79+
rebar3 ex_doc
80+
rebar3 hex docs publish --yes
7381
env:
7482
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}

0 commit comments

Comments
 (0)