Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make token optional, allow inherit #31

Merged
merged 1 commit into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading