Skip to content

Commit

Permalink
passing github envs as inputs and secrets to the publish reusable wor…
Browse files Browse the repository at this point in the history
…kflow
  • Loading branch information
Dpbm committed Jan 27, 2025
1 parent 62feab8 commit 3f2b740
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/publish-test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ jobs:
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
GPG_KEYID: ${{ secrets.GPG_KEYID }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
actor: ${{ github.actor }}
11 changes: 9 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
type: string
description: 'Set as production to publish your artifacts'
default: 'test'
actor:
type: string
description: 'Your github username'
required: true
secrets:
GPG_KEY:
description: 'Your private GPG KEY'
Expand All @@ -16,6 +20,9 @@ on:
GPG_KEYID:
description: 'Your GPG KEY last 8 digits'
required: true
GH_TOKEN:
description: 'Your secret GITHUB_TOKEN'
required: true

jobs:
publish_github:
Expand Down Expand Up @@ -47,5 +54,5 @@ jobs:
if: ${{ inputs.env == 'production' }}
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_ACTOR: ${{ inputs.actor }}
2 changes: 2 additions & 0 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ jobs:
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
GPG_KEYID: ${{ secrets.GPG_KEYID }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
env: 'production'
actor: ${{ github.actor }}

0 comments on commit 3f2b740

Please sign in to comment.