Skip to content

Commit

Permalink
Only persist git credentials where we need to use them
Browse files Browse the repository at this point in the history
- Don't leave these around when we don't need to.
- Explicitly set to true where we need them, with a comment highlighting why we're keeping them.
- Fix a few places we weren't using the centrally managed checkout version.
- Tweak the conditionals for submodules so the `with:` is always there now.
  • Loading branch information
danielrbradley committed Oct 31, 2024
1 parent 1dae09c commit a9c7f2f
Show file tree
Hide file tree
Showing 94 changed files with 241 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ jobs:
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ jobs:
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- name: Cache examples generation
uses: actions/cache@v4
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ jobs:
steps:
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
# Persist credentials so upgrade-provider can push a new branch.
persist-credentials: true
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ jobs:
swap-storage: false
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- name: Configure AWS Credentials
uses: #{{ .Config.actionVersions.configureAwsCredentials }}#
with:
Expand Down Expand Up @@ -140,10 +141,11 @@ jobs:
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ jobs:
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ jobs:
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ jobs:
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- uses: pulumi/provider-version-action@v1
id: provider-version
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ jobs:
run: echo "Can't skip Go SDK for stable releases. This is likely a bug in the calling workflow." && exit 1
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down Expand Up @@ -102,10 +103,12 @@ jobs:
steps:
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
# Persist credentials so we can push back to the repo
persist-credentials: true
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down Expand Up @@ -168,7 +171,9 @@ jobs:
runs-on: #{{ .Config.runner.default }}#
steps:
- name: Checkout Repo
uses: actions/checkout@v4
uses: #{{ .Config.actionVersions.checkout }}#
with:
persist-credentials: false
- name: Clean up release labels
uses: pulumi/action-release-by-pr-label@main
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ jobs:
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ jobs:
steps:
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
# Persist credentials so we can push a new branch.
persist-credentials: true
- name: Checkout repo
uses: #{{ .Config.actionVersions.checkout }}#
with:
path: ci-mgmt
repository: pulumi/ci-mgmt
persist-credentials: false
- id: run-url
name: Create URL to the run output
run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> "$GITHUB_OUTPUT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ jobs:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
persist-credentials: false
- name: Checkout p/examples
if: matrix.testTarget == 'pulumiExamples'
uses: #{{ .Config.actionVersions.checkout }}#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ jobs:
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ jobs:
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
# Persist credentials so upgrade-provider can push a new branch.
persist-credentials: true
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jobs:
runs-on: #{{ .Config.runner.default }}#
steps:
- name: Checkout Repo
uses: actions/checkout@v4
uses: #{{ .Config.actionVersions.checkout }}#
with:
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ jobs:
steps:
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- name: Install go
uses: actions/setup-go@v5
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ jobs:
steps:
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- name: Comment PR
uses: #{{ .Config.actionVersions.prComment }}#
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ jobs:
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
uses: #{{ .Config.actionVersions.checkout }}#
with:
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ jobs:
steps:
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- uses: peter-evans/slash-command-dispatch@v4
with:
commands: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ jobs:
steps:
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
#{{- if .Config.checkoutSubmodules }}#
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
#{{- end }}#
persist-credentials: false
- id: schema_changed
name: Check for diff in schema
uses: #{{ .Config.actionVersions.pathsFilter }}#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
with:
persist-credentials: false
- name: Should release PR
uses: pulumi/action-release-by-pr-label@main
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Cache examples generation
uses: actions/cache@v4
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
# Persist credentials so upgrade-provider can push a new branch.
persist-credentials: true
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
2 changes: 2 additions & 0 deletions provider-ci/test-providers/acme/.github/workflows/license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
2 changes: 2 additions & 0 deletions provider-ci/test-providers/acme/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install go
uses: actions/setup-go@v5
with:
Expand Down
4 changes: 4 additions & 0 deletions provider-ci/test-providers/acme/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
swap-storage: false
- name: Checkout Repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down Expand Up @@ -136,6 +138,8 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: pulumi/provider-version-action@v1
id: provider-version
with:
Expand Down
Loading

0 comments on commit a9c7f2f

Please sign in to comment.