Skip to content

Commit eee5371

Browse files
authored
Merge pull request #211 from gruntwork-io/add-post-access-control
Add new post access control custom action
2 parents 20b3edf + ad5c602 commit eee5371

4 files changed

Lines changed: 29 additions & 8 deletions

File tree

.github/workflows/pipelines-drift-detection.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ on:
4444
description: "Repository to fetch pipelines actions from (e.g. use your org/repo for self-hosted)"
4545
pipelines_actions_ref:
4646
type: string
47-
default: "v4.6.0"
47+
default: "v4.7.0"
4848
description: "For Gruntwork internal testing - the ref of the pipelines actions to use"
4949
pipelines_credentials_repo:
5050
type: string

.github/workflows/pipelines-root.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ on:
3838
description: "Repository to fetch pipelines actions from (e.g. use your org/repo for self-hosted)"
3939
pipelines_actions_ref:
4040
type: string
41-
default: "v4.6.0"
41+
default: "v4.7.0"
4242
description: "For Gruntwork internal testing - the ref of the pipelines actions to use"
4343
pipelines_actions_customizations_repo:
4444
type: string
@@ -582,7 +582,7 @@ jobs:
582582
version: ${{ env.PIPELINES_CLI_VERSION }}
583583
PIPELINES_GRUNTWORK_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read }}
584584

585-
- name: "Provision access control account(s) and create PR"
585+
- name: "Provision access control account(s)"
586586
id: access_control_account
587587
uses: ./pipelines-actions/.github/actions/pipelines-provision-access-control-action
588588
with:
@@ -591,13 +591,34 @@ jobs:
591591
PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
592592
ORG_REPO_ADMIN_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).org_repo_admin }}
593593

594+
# To learn more about customizing Pipelines see our documentation at https://docs.gruntwork.io/pipelines/maintain/extending/
595+
- name: "Post access control account custom action"
596+
uses: ./${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_PATH }}/.github/custom-actions/post-access-control-account
597+
with:
598+
job: ${{ toJson(fromJson(needs.pipelines_orchestrate.outputs.pipelines_jobs)[0]) }}
599+
account_names: ${{ join(fromJson(needs.pipelines_orchestrate.outputs.pipelines_jobs)[0].NewAccounts.*.Name, ',') }}
600+
access_control_repo_dir: ${{ steps.access_control_account.outputs.access_control_repo_dir }}
601+
PIPELINES_GRUNTWORK_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read }}
602+
PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
603+
ORG_REPO_ADMIN_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).org_repo_admin }}
604+
605+
- name: "Create access control account pull request"
606+
id: access_control_account_pr
607+
uses: ./pipelines-actions/.github/actions/pipelines-access-control-new-pr-action
608+
with:
609+
job: ${{ toJson(fromJson(needs.pipelines_orchestrate.outputs.pipelines_jobs)[0]) }}
610+
access_control_repo_dir: ${{ steps.access_control_account.outputs.access_control_repo_dir }}
611+
PIPELINES_GRUNTWORK_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read }}
612+
PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
613+
ORG_REPO_ADMIN_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).org_repo_admin }}
614+
594615
- name: "Create delegated repo and bootstrap"
595616
id: provision_delegated_repo
596617
uses: ./pipelines-actions/.github/actions/pipelines-provision-repo-action
597618
with:
598619
job: ${{ toJson(fromJson(needs.pipelines_orchestrate.outputs.pipelines_jobs)[0]) }}
599620
workflow_job_name: ${{ env.JOB_NAME }}
600-
access_control_pull_request_url: ${{ steps.access_control_account.outputs.pull_request_url }}
621+
access_control_pull_request_url: ${{ steps.access_control_account_pr.outputs.pull_request_url }}
601622
new_account_name: ${{ fromJson(needs.pipelines_orchestrate.outputs.pipelines_jobs)[0].NewAccounts[0].Name }}
602623
PIPELINES_GRUNTWORK_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read }}
603624
PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
@@ -607,7 +628,7 @@ jobs:
607628
- name: "Post create delegated repo custom actions"
608629
uses: ./${{ env.PIPELINES_ACTIONS_CUSTOMIZATIONS_PATH }}/.github/custom-actions/post-create-delegated-repo
609630
with:
610-
access_control_pull_request_url: ${{ steps.access_control_account.outputs.pull_request_url }}
631+
access_control_pull_request_url: ${{ steps.access_control_account_pr.outputs.pull_request_url }}
611632
PIPELINES_GRUNTWORK_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).gruntwork_read }}
612633
PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).customer_org_read }}
613634
ORG_REPO_ADMIN_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).org_repo_admin }}
@@ -621,7 +642,7 @@ jobs:
621642
delegated_repo_path: ${{ steps.provision_delegated_repo.outputs.delegated_repo_path }}
622643
delegated_step_output_file_path: ${{ steps.provision_delegated_repo.outputs.step_output_file_path }}
623644
delegated_step_output_file_name: ${{ steps.provision_delegated_repo.outputs.step_output_file_name }}
624-
access_control_pr_url: ${{ steps.access_control_account.outputs.pull_request_url }}
645+
access_control_pr_url: ${{ steps.access_control_account_pr.outputs.pull_request_url }}
625646
GH_TOKEN: ${{ fromJson(steps.pipelines-tokens.outputs.tokens_json).org_repo_admin }}
626647

627648
pipelines_status_check:

.github/workflows/pipelines-unlock.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ on:
5555
description: "Repository to fetch pipelines actions from (e.g. use your org/repo for self-hosted)"
5656
pipelines_actions_ref:
5757
type: string
58-
default: "v4.6.0"
58+
default: "v4.7.0"
5959
description: "For Gruntwork internal testing - the ref of the pipelines actions to use"
6060
pipelines_credentials_repo:
6161
type: string

.github/workflows/pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ on:
3838
description: "Repository to fetch pipelines actions from (e.g. use your org/repo for self-hosted)"
3939
pipelines_actions_ref:
4040
type: string
41-
default: "v4.6.0"
41+
default: "v4.7.0"
4242
description: "For Gruntwork internal testing - the ref of the pipelines actions to use"
4343
pipelines_credentials_repo:
4444
type: string

0 commit comments

Comments
 (0)