Skip to content

Pass cli, actions, and credentials versions as inputs #126

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

Merged
merged 1 commit into from
Jun 23, 2025
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
59 changes: 47 additions & 12 deletions .github/workflows/pipelines-drift-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,28 @@ on:
api_base_url:
type: string
default: "https://api.prod.app.gruntwork.io/api/v1"
pipelines_cli_version:
type: string
default: "v0.40.0-rc11"
description: "For Gruntwork internal testing - the version of the pipelines CLI to use"
pipelines_actions_ref:
type: string
default: "main"
description: "For Gruntwork internal testing - the ref of the pipelines actions to use"
pipelines_credentials_ref:
type: string
default: "v1"
description: "For Gruntwork internal testing - the ref of the pipelines credentials to use"

secrets:
PIPELINES_READ_TOKEN:
required: false
PR_CREATE_TOKEN:
required: false
env:
PIPELINES_CLI_VERSION: v0.40.0-rc11
PIPELINES_ACTIONS_VERSION: main
PIPELINES_CLI_VERSION: ${{ inputs.pipelines_cli_version }}
PIPELINES_ACTIONS_REF: ${{ inputs.pipelines_actions_ref }}
PIPELINES_CREDENTIALS_REF: ${{ inputs.pipelines_credentials_ref }}
BOILERPLATE_VERSION: v0.5.16
GRUNTWORK_INSTALLER_VERSION: v0.0.40

Expand All @@ -48,17 +62,24 @@ jobs:
outputs:
units: ${{ steps.determine-units.outputs.units }}
steps:
- name: Checkout Pipelines Credentials
uses: actions/checkout@v4
with:
path: pipelines-credentials
repository: gruntwork-io/pipelines-credentials
ref: ${{ env.PIPELINES_CREDENTIALS_REF }}

- name: Fetch Gruntwork Read Token
id: pipelines-gruntwork-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: "pipelines-read/gruntwork-io"
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Org Read Token
id: pipelines-customer-org-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: pipelines-read/${{ github.repository_owner }}
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
Expand All @@ -69,7 +90,7 @@ jobs:
with:
path: pipelines-actions
repository: gruntwork-io/pipelines-actions
ref: ${{ env.PIPELINES_ACTIONS_VERSION }}
ref: ${{ env.PIPELINES_ACTIONS_REF }}
token: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }}

- name: Check out repo code
Expand Down Expand Up @@ -98,17 +119,24 @@ jobs:
JOB_NAME: Detect Drift in ${{ matrix.unit.path }}
name: Detect Drift in ${{ matrix.unit.path }}
steps:
- name: Checkout Pipelines Credentials
uses: actions/checkout@v4
with:
path: pipelines-credentials
repository: gruntwork-io/pipelines-credentials
ref: ${{ env.PIPELINES_CREDENTIALS_REF }}

- name: Fetch Gruntwork Read Token
id: pipelines-gruntwork-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: "pipelines-read/gruntwork-io"
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Org Read Token
id: pipelines-customer-org-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: pipelines-read/${{ github.repository_owner }}
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
Expand All @@ -119,7 +147,7 @@ jobs:
with:
path: pipelines-actions
repository: gruntwork-io/pipelines-actions
ref: ${{ env.PIPELINES_ACTIONS_VERSION }}
ref: ${{ env.PIPELINES_ACTIONS_REF }}
token: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }}

- name: Check out repo code
Expand All @@ -145,25 +173,32 @@ jobs:
runs-on: ${{ fromJSON(inputs.runner) }}
needs: pipelines_drift_detection
steps:
- name: Checkout Pipelines Credentials
uses: actions/checkout@v4
with:
path: pipelines-credentials
repository: gruntwork-io/pipelines-credentials
ref: ${{ env.PIPELINES_CREDENTIALS_REF }}

- name: Fetch Gruntwork Read Token
id: pipelines-gruntwork-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: "pipelines-read/gruntwork-io"
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Org Read Token
id: pipelines-customer-org-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: pipelines-read/${{ github.repository_owner }}
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Create PR Token
id: pipelines-propose-infra-change-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: propose-infra-change/${{ github.repository_owner }}
FALLBACK_TOKEN: ${{ secrets.PR_CREATE_TOKEN }}
Expand All @@ -174,7 +209,7 @@ jobs:
with:
path: pipelines-actions
repository: gruntwork-io/pipelines-actions
ref: ${{ env.PIPELINES_ACTIONS_VERSION }}
ref: ${{ env.PIPELINES_ACTIONS_REF }}
token: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }}

- name: Check out repo code
Expand Down
81 changes: 61 additions & 20 deletions .github/workflows/pipelines-root.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ on:
type: string
default: ""
description: "Override where we fetch pipelines from, used for internal testing"
pipelines_cli_version:
type: string
default: "v0.40.0-rc11"
description: "For Gruntwork internal testing - the version of the pipelines CLI to use"
pipelines_actions_ref:
type: string
default: "main"
description: "For Gruntwork internal testing - the ref of the pipelines actions to use"
pipelines_credentials_ref:
type: string
default: "v1"
description: "For Gruntwork internal testing - the ref of the pipelines credentials to use"

secrets:
PIPELINES_READ_TOKEN:
Expand All @@ -38,8 +50,9 @@ on:
required: false

env:
PIPELINES_CLI_VERSION: v0.40.0-rc11
PIPELINES_ACTIONS_VERSION: main
PIPELINES_CLI_VERSION: ${{ inputs.pipelines_cli_version }}
PIPELINES_ACTIONS_REF: ${{ inputs.pipelines_actions_ref }}
PIPELINES_CREDENTIALS_REF: ${{ inputs.pipelines_credentials_ref }}
BOILERPLATE_VERSION: v0.5.16
GRUNTWORK_INSTALLER_VERSION: v0.0.40

Expand Down Expand Up @@ -67,33 +80,40 @@ jobs:
echo "PIPELINES_JOB_START_TIME=$time_now" >> $GITHUB_ENV
echo "PIPELINES_BINARY_URL=$PIPELINES_BINARY_URL" >> $GITHUB_ENV

- name: Checkout Pipelines Credentials
uses: actions/checkout@v4
with:
path: pipelines-credentials
repository: gruntwork-io/pipelines-credentials
ref: ${{ env.PIPELINES_CREDENTIALS_REF }}

- name: Fetch Gruntwork Read Token
id: pipelines-gruntwork-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: "pipelines-read/gruntwork-io"
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Org Read Token
id: pipelines-customer-org-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: pipelines-read/${{ github.repository_owner }}
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Infra Root Write Token
id: pipelines-infra-root-write-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: infra-root-write/${{ github.repository_owner }}
FALLBACK_TOKEN: ${{ secrets.INFRA_ROOT_WRITE_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Org Repo Admin Token
id: pipelines-org-repo-admin-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
continue-on-error: true
with:
PIPELINES_TOKEN_PATH: org-repo-admin/${{ github.repository_owner }}
Expand All @@ -106,7 +126,7 @@ jobs:
with:
path: pipelines-actions
repository: gruntwork-io/pipelines-actions
ref: ${{ env.PIPELINES_ACTIONS_VERSION }}
ref: ${{ env.PIPELINES_ACTIONS_REF }}
token: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }}

- name: Report error if token with access to gruntwork repos is invalid
Expand Down Expand Up @@ -180,25 +200,32 @@ jobs:
echo "PIPELINES_JOB_START_TIME=$time_now" >> $GITHUB_ENV
echo "PIPELINES_BINARY_URL=$PIPELINES_BINARY_URL" >> $GITHUB_ENV

- name: Checkout Pipelines Credentials
uses: actions/checkout@v4
with:
path: pipelines-credentials
repository: gruntwork-io/pipelines-credentials
ref: ${{ env.PIPELINES_CREDENTIALS_REF }}

- name: Fetch Gruntwork Read Token
id: pipelines-gruntwork-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: "pipelines-read/gruntwork-io"
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Org Read Token
id: pipelines-customer-org-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: pipelines-read/${{ github.repository_owner }}
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Infra Root Write Token
id: pipelines-infra-root-write-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: infra-root-write/${{ github.repository_owner }}
FALLBACK_TOKEN: ${{ secrets.INFRA_ROOT_WRITE_TOKEN }}
Expand All @@ -217,7 +244,7 @@ jobs:
with:
path: pipelines-actions
repository: gruntwork-io/pipelines-actions
ref: ${{ env.PIPELINES_ACTIONS_VERSION }}
ref: ${{ env.PIPELINES_ACTIONS_REF }}
token: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }}

- name: Check out repo code
Expand Down Expand Up @@ -376,25 +403,32 @@ jobs:
matrix:
jobs: ${{ fromJson(needs.pipelines_orchestrate.outputs.pipelines_jobs)[0].NewAccounts }}
steps:
- name: Checkout Pipelines Credentials
uses: actions/checkout@v4
with:
path: pipelines-credentials
repository: gruntwork-io/pipelines-credentials
ref: ${{ env.PIPELINES_CREDENTIALS_REF }}

- name: Fetch Gruntwork Read Token
id: pipelines-gruntwork-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: "pipelines-read/gruntwork-io"
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Org Read Token
id: pipelines-customer-org-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: pipelines-read/${{ github.repository_owner }}
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Create PR Token
id: pipelines-propose-infra-change-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: propose-infra-change/${{ github.repository_owner }}
FALLBACK_TOKEN: ${{ secrets.INFRA_ROOT_WRITE_TOKEN }}
Expand All @@ -405,7 +439,7 @@ jobs:
with:
path: pipelines-actions
repository: gruntwork-io/pipelines-actions
ref: ${{ env.PIPELINES_ACTIONS_VERSION }}
ref: ${{ env.PIPELINES_ACTIONS_REF }}
token: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }}

- name: Check out repo code
Expand Down Expand Up @@ -499,25 +533,32 @@ jobs:
# GHA can't check for length, so we just check if there is an item in the 0 index
if: ${{ fromJson(needs.pipelines_orchestrate.outputs.pipelines_jobs)[0].NewAccounts[0] != null && needs.pipelines_execute.outputs.delegate_management == 'true' && needs.pipelines_execute.outputs.terragrunt_command == 'run-all apply' }}
steps:
- name: Checkout Pipelines Credentials
uses: actions/checkout@v4
with:
path: pipelines-credentials
repository: gruntwork-io/pipelines-credentials
ref: ${{ env.PIPELINES_CREDENTIALS_REF }}

- name: Fetch Gruntwork Read Token
id: pipelines-gruntwork-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: "pipelines-read/gruntwork-io"
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Org Read Token
id: pipelines-customer-org-read-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: pipelines-read/${{ github.repository_owner }}
FALLBACK_TOKEN: ${{ secrets.PIPELINES_READ_TOKEN }}
api_base_url: ${{ inputs.api_base_url }}

- name: Fetch Org Repo Admin Token
id: pipelines-org-repo-admin-token
uses: gruntwork-io/pipelines-credentials@v1
uses: ./pipelines-credentials
with:
PIPELINES_TOKEN_PATH: org-repo-admin/${{ github.repository_owner }}
FALLBACK_TOKEN: ${{ secrets.ORG_REPO_ADMIN_TOKEN }}
Expand All @@ -528,7 +569,7 @@ jobs:
with:
path: pipelines-actions
repository: gruntwork-io/pipelines-actions
ref: ${{ env.PIPELINES_ACTIONS_VERSION }}
ref: ${{ env.PIPELINES_ACTIONS_REF }}
token: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }}

- name: Check out repo code
Expand Down Expand Up @@ -646,7 +687,7 @@ jobs:
with:
path: pipelines-actions
repository: gruntwork-io/pipelines-actions
ref: ${{ env.PIPELINES_ACTIONS_VERSION }}
ref: ${{ env.PIPELINES_ACTIONS_REF }}
token: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }}

- name: Check out repo code
Expand Down
Loading