Skip to content

Commit 6d1a6db

Browse files
committed
Add token inputs to build-product.yml
1 parent c6d8d80 commit 6d1a6db

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.github/workflows/build-product.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ on:
1515
required: false
1616
GITLAB_HOST:
1717
required: false
18+
inputs:
19+
token:
20+
type: string
21+
required: false
22+
description: Token to pass to the build-single and build-workspace jobs. Use this to allow the checkout actions to access private repositories.
1823

1924
concurrency:
2025
group: "${{ github.workflow }}-${{ github.ref || github.head_ref }}"
@@ -87,13 +92,14 @@ jobs:
8792
fail-fast: true
8893
matrix:
8994
component: ${{fromJson(needs.prepare-build.outputs.components)}}
90-
uses: datavisyn/github-workflows/.github/workflows/build-single-product-part.yml@new_deployment
95+
uses: datavisyn/github-workflows/.github/workflows/build-single-product-part.yml@new_deployment-product_token
9196
with:
9297
component: ${{ matrix.component }}
9398
image_tag1: ${{ needs.prepare-build.outputs.image_tag1 }}
9499
image_tag2: ${{ needs.prepare-build.outputs.image_tag2 }}
95100
build_time: ${{ needs.prepare-build.outputs.build_time }}
96101
stage: ${{ needs.prepare-build.outputs.stage }}
102+
token: ${{ inputs.token }}
97103
secrets: inherit
98104
build-workspace:
99105
needs: prepare-build

.github/workflows/build-single-product-part.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ on:
3838
description: "stage for the image (develop or production) depending on the branch name"
3939
required: true
4040
type: string
41+
token:
42+
description: "token to use for the checkout actions to access private repositories"
43+
required: false
44+
type: string
4145
env:
4246
TIME_ZONE: "Europe/Vienna"
4347
NODE_VERSION: "20.9"
@@ -58,7 +62,7 @@ jobs:
5862
# checkout specific repository
5963
- uses: actions/checkout@v3
6064
with:
61-
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
65+
token: ${{ inputs.token || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
6266
# checkout this workflow repository to get actions
6367
- uses: actions/checkout@v3
6468
with:
@@ -121,7 +125,7 @@ jobs:
121125
git config --global url."git+https://$GITLAB_TOKEN@$GITLAB_HOST/".insteadOf "git+ssh://git@$GITLAB_HOST:"
122126
fi
123127
env:
124-
_GITHUB_TOKEN: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
128+
_GITHUB_TOKEN: ${{ inputs.token || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
125129
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
126130
GITLAB_HOST: ${{ secrets.GITLAB_HOST }}
127131
- name: Git clone app
@@ -141,7 +145,7 @@ jobs:
141145
REPO: ${{ steps.get-parameters.outputs.repo }}
142146
BRANCH: ${{ steps.get-parameters.outputs.branch }}
143147
APP: ${{ steps.get-parameters.outputs.app }}
144-
GH_TOKEN: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
148+
GH_TOKEN: ${{ inputs.token || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
145149
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
146150
GITLAB_HOST: ${{ secrets.GITLAB_HOST }}
147151
- name: Copy docker sources

0 commit comments

Comments
 (0)