Skip to content

Commit 0a3756a

Browse files
committed
fix: resolve token issues
1 parent dce70e5 commit 0a3756a

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

.github/actions/publish/action.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,18 @@ description: Publish to Elm registry and create GitHub release
55
inputs:
66
dry-run:
77
description: Run in dry-run mode
8-
required: true
8+
required: false
99
type: boolean
10+
default: false
11+
github-token:
12+
description: GitHub token for publishing
13+
required: true
14+
type: string
15+
path-to-elm:
16+
description: Path to elm binary
17+
required: false
18+
type: string
19+
default: ./node_modules/.bin/elm
1020

1121
runs:
1222
using: composite
@@ -25,14 +35,14 @@ runs:
2535
id: elm-publish
2636
uses: dillonkearns/elm-publish-action@v2
2737
with:
28-
github-token: ${{ inputs.dry-run == false && github.token || '' }}
29-
path-to-elm: ./node_modules/.bin/elm
38+
github-token: ${{ inputs.github-token }}
39+
path-to-elm: ${{ inputs.path-to-elm }}
3040
dry-run: ${{ inputs.dry-run }}
3141

3242
- name: Create GitHub Release
3343
if: inputs.dry-run == false && success()
3444
env:
35-
GH_TOKEN: ${{ github.token }}
45+
GH_TOKEN: ${{ inputs.github-token }}
3646
run: |
3747
VERSION=$(jq -r '.version' elm.json)
3848
gh release create "$VERSION" --generate-notes

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737

3838
- uses: ./.github/actions/publish
3939
with:
40-
dry-run: false
40+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
uses: ./.github/actions/publish
6868
with:
6969
dry-run: true
70+
github-token: ''
7071

7172
- name: Fail if not publishable
7273
if: steps.publish.outputs.is-publishable != 'true'

0 commit comments

Comments
 (0)