Skip to content

Commit

Permalink
Move GitHub token to workflow and pass as a parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Nov 6, 2024
1 parent 3c8d7fe commit 748fc37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ inputs:
ignore-linting-rules:
required: false
type: string
github-token:
required: true
type: string

runs:
using: "composite"
Expand All @@ -35,7 +38,7 @@ runs:
shellcheck --external-sources --exclude=SC2148 ./Dockerfile
shell: bash
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
run: echo "${{ inputs.github-token }}" | docker login ghcr.io -u $ --password-stdin
shell: bash
- name: Prepare image tag
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
docker-context: docker/tna-python
dockerfile: Dockerfile
ignore-linting-rules: DL3002,DL3006
github-token: ${{ secrets.GITHUB_TOKEN }}

python-root:
name: Python (root)
Expand All @@ -54,6 +55,7 @@ jobs:
user-image: root
dockerfile: Dockerfile
ignore-linting-rules: DL3002,DL3006
github-token: ${{ secrets.GITHUB_TOKEN }}

python-django:
name: Python Django
Expand All @@ -69,6 +71,7 @@ jobs:
base-image: ghcr.io/nationalarchives/tna-python
docker-context: docker/tna-python-django
dockerfile: Dockerfile
github-token: ${{ secrets.GITHUB_TOKEN }}

python-django-root:
name: Python Django (root)
Expand All @@ -85,6 +88,7 @@ jobs:
docker-context: docker/tna-python-django
dockerfile: Dockerfile
ignore-linting-rules: DL3002
github-token: ${{ secrets.GITHUB_TOKEN }}

python-dev:
name: Python Dev
Expand All @@ -101,3 +105,4 @@ jobs:
docker-context: docker/tna-python-dev
dockerfile: Dockerfile
ignore-linting-rules: DL3002,DL3008
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 748fc37

Please sign in to comment.