Skip to content

Commit

Permalink
feat: make token optional, allow inherit (#31)
Browse files Browse the repository at this point in the history
Make token optional, allow inherit
  • Loading branch information
DerekRoberts authored Sep 23, 2023
1 parent e094155 commit afa7a04
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
package: backend
tag: ${{ github.event.number }}
tag_fallback: test
token: ${{ secrets.GITHUB_TOKEN }}
triggers: ('backend/')

# QuickStart apps build from the same dirs as their Dockerfiles
Expand All @@ -37,7 +36,6 @@ jobs:
package: frontend
repository: bcgov/nr-quickstart-typescript
tag: ${{ github.event.number }}
token: ${{ secrets.GITHUB_TOKEN }}

# FOM apps build from repo root, one above their Dockerfiles
advanced:
Expand All @@ -54,4 +52,3 @@ jobs:
build_file: api/Dockerfile
repository: bcgov/nr-fom
tag: ${{ github.event.number }}
token: ${{ secrets.GITHUB_TOKEN }}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ Only GitHub Container Registry (ghcr.io) is supported so far.
# Tag name (<package>:<tag>)
tag: ${{ github.event.number }}

# Usually ${{ secrets.GITHUB_TOKEN }}, but a personal access token works too
token: ${{ secrets.GITHUB_TOKEN }}


### Typical / recommended

Expand Down Expand Up @@ -66,6 +63,10 @@ Only GitHub Container Registry (ghcr.io) is supported so far.
# Useful for consuming other repos, like in testing
# Defaults to the current one
repository: ${{ github.repository }}

# Specify token (GH or PAT), instead of inheriting one from the calling workflow
token: ${{ secrets.GITHUB_TOKEN }}

```

# Example, Single Build
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ inputs:
tag:
description: Default tag; e.g. pr#, test, prod
required: true
token:
description: Default github token or personal access token
required: true

### Typical / recommended
tag_fallback:
Expand All @@ -35,6 +32,9 @@ inputs:
repository:
default: ${{ github.repository }}
description: Non-default repo to clone
token:
description: Specify token (GH or PAT), instead of inheriting one from the calling workflow
default: ${{ github.token }}

outputs:
build:
Expand Down

0 comments on commit afa7a04

Please sign in to comment.