Skip to content

Commit ef56aa2

Browse files
committed
Add inputs to specify a separate repository for custom actions
1 parent 6699a9b commit ef56aa2

1 file changed

Lines changed: 45 additions & 7 deletions

File tree

.github/workflows/pipelines-root.yml

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ on:
4040
type: string
4141
default: "v4.6.0"
4242
description: "For Gruntwork internal testing - the ref of the pipelines actions to use"
43+
pipelines_actions_customizations_repo:
44+
type: string
45+
default: ""
46+
description: "Repository to fetch pipelines actions customizations from"
47+
pipelines_actions_customizations_ref:
48+
type: string
49+
default: ""
50+
description: "Ref of pipelines actions customizations"
4351
pipelines_credentials_repo:
4452
type: string
4553
default: "gruntwork-io/pipelines-credentials"
@@ -65,6 +73,9 @@ env:
6573
PIPELINES_CLI_VERSION: ${{ inputs.pipelines_cli_version }}
6674
PIPELINES_ACTIONS_REPO: ${{ inputs.pipelines_actions_repo }}
6775
PIPELINES_ACTIONS_REF: ${{ inputs.pipelines_actions_ref }}
76+
PIPELINES_ACTIONS_CUSTOMIZATIONS_REPO: ${{ inputs.pipelines_actions_customizations_repo }}
77+
PIPELINES_ACTIONS_CUSTOMIZATIONS_REF: ${{ inputs.pipelines_actions_customizations_ref }}
78+
PIPELINES_ACTIONS_CUSTOMIZATIONS_PATH: ${{ inputs.pipelines_actions_customizations_repo && 'pipelines-actions-customizations' || 'pipelines-actions' }}
6879
PIPELINES_CREDENTIALS_REPO: ${{ inputs.pipelines_credentials_repo }}
6980
PIPELINES_CREDENTIALS_REF: ${{ inputs.pipelines_credentials_ref }}
7081
BOILERPLATE_VERSION: v0.5.16
@@ -232,6 +243,15 @@ jobs:
232243
ref: ${{ env.PIPELINES_ACTIONS_REF }}
233244
token: ${{ env.PIPELINES_ACTIONS_REPO == 'gruntwork-io/pipelines-actions' && fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read || fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
234245

246+
- name: Checkout Pipelines Actions Customizations
247+
if: ${{ inputs.pipelines_actions_customizations_repo }}
248+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
249+
with:
250+
path: pipelines-actions-customizations
251+
repository: ${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_REPO }}
252+
ref: ${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_REF }}
253+
token: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
254+
235255
- name: Check out repo code
236256
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
237257
with:
@@ -262,7 +282,7 @@ jobs:
262282

263283
# To learn more about customizing Pipelines see our documentation at https://docs.gruntwork.io/pipelines/maintain/extending/
264284
- name: "[Baseline]: Pre Provision New Account Custom Action"
265-
uses: ./pipelines-actions/.github/custom-actions/pre-provision-new-account
285+
uses: ./${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_PATH }}/.github/custom-actions/pre-provision-new-account
266286
if: ${{ matrix.jobs.ChangeType == 'AccountsRequested' }}
267287
with:
268288
PIPELINES_GRUNTWORK_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read }}
@@ -282,7 +302,7 @@ jobs:
282302
workflow_job_name: ${{ env.JOB_NAME }}
283303

284304
- name: "[ProvisionAccount]: Post Provision New Account Custom Action"
285-
uses: ./pipelines-actions/.github/custom-actions/post-provision-new-account
305+
uses: ./${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_PATH }}/.github/custom-actions/post-provision-new-account
286306
if: ${{ matrix.jobs.ChangeType == 'AccountsRequested' }}
287307
with:
288308
PIPELINES_GRUNTWORK_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read }}
@@ -308,7 +328,7 @@ jobs:
308328
--job "$JOB"
309329
310330
- name: "[Baseline]: Pre Baseline Core Account Action"
311-
uses: ./pipelines-actions/.github/custom-actions/pre-baseline-core-accounts
331+
uses: ./${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_PATH }}/.github/custom-actions/pre-baseline-core-accounts
312332
if: ${{ matrix.jobs.ChangeType == 'AccountsAdded' }}
313333
with:
314334
PIPELINES_GRUNTWORK_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read }}
@@ -329,7 +349,7 @@ jobs:
329349
workflow_job_name: ${{ env.JOB_NAME }}
330350

331351
- name: "[Baseline]: Post Baseline Core Account Action"
332-
uses: ./pipelines-actions/.github/custom-actions/post-baseline-core-accounts
352+
uses: ./${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_PATH }}/.github/custom-actions/post-baseline-core-accounts
333353
if: ${{ matrix.jobs.ChangeType == 'AccountsAdded' }}
334354
with:
335355
PIPELINES_GRUNTWORK_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read }}
@@ -423,6 +443,15 @@ jobs:
423443
ref: ${{ env.PIPELINES_ACTIONS_REF }}
424444
token: ${{ env.PIPELINES_ACTIONS_REPO == 'gruntwork-io/pipelines-actions' && fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read || fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
425445

446+
- name: Checkout Pipelines Actions Customizations
447+
if: ${{ inputs.pipelines_actions_customizations_repo }}
448+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
449+
with:
450+
path: pipelines-actions-customizations
451+
repository: ${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_REPO }}
452+
ref: ${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_REF }}
453+
token: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
454+
426455
- name: Check out repo code
427456
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
428457
with:
@@ -453,7 +482,7 @@ jobs:
453482

454483
# To learn more about customizing Pipelines see our documentation at https://docs.gruntwork.io/pipelines/maintain/extending/
455484
- name: "[Baseline]: Pre Baseline Child Account Action"
456-
uses: ./pipelines-actions/.github/custom-actions/pre-baseline-child-account
485+
uses: ./${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_PATH }}/.github/custom-actions/pre-baseline-child-account
457486
with:
458487
PIPELINES_GRUNTWORK_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read }}
459488
PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
@@ -472,7 +501,7 @@ jobs:
472501
workflow_job_name: ${{ env.JOB_NAME }}
473502

474503
- name: "[Baseline]: Post Baseline Child Account Action"
475-
uses: ./pipelines-actions/.github/custom-actions/post-baseline-child-account
504+
uses: ./${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_PATH }}/.github/custom-actions/post-baseline-child-account
476505
with:
477506
PIPELINES_GRUNTWORK_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read }}
478507
PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
@@ -531,6 +560,15 @@ jobs:
531560
ref: ${{ env.PIPELINES_ACTIONS_REF }}
532561
token: ${{ env.PIPELINES_ACTIONS_REPO == 'gruntwork-io/pipelines-actions' && fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read || fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
533562

563+
- name: Checkout Pipelines Actions Customizations
564+
if: ${{ inputs.pipelines_actions_customizations_repo }}
565+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
566+
with:
567+
path: pipelines-actions-customizations
568+
repository: ${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_REPO }}
569+
ref: ${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_REF }}
570+
token: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
571+
534572
- name: Check out repo code
535573
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
536574
with:
@@ -567,7 +605,7 @@ jobs:
567605

568606
# To learn more about customizing Pipelines see our documentation at https://docs.gruntwork.io/pipelines/maintain/extending/
569607
- name: "Post create delegated repo custom actions"
570-
uses: ./pipelines-actions/.github/custom-actions/post-create-delegated-repo
608+
uses: ./${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_PATH }}/.github/custom-actions/post-create-delegated-repo
571609
with:
572610
access_control_pull_request_url: ${{ steps.access_control_account.outputs.pull_request_url }}
573611
PIPELINES_GRUNTWORK_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read }}

0 commit comments

Comments
 (0)