Skip to content

Commit ea36636

Browse files
committed
chore: pin versions of workflow actions
1 parent d6a9e17 commit ea36636

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

.github/workflows/chocolatey.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ jobs:
2323
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'v')) }}
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2727

2828
- name: Unshallow
2929
run: git fetch --prune --unshallow
3030

3131
- name: Get latest release tag
32-
uses: oprypin/find-latest-tag@v1
32+
uses: oprypin/find-latest-tag@dd2729fe78b0bb55523ae2b2a310c6773a652bd1 # v1.1.2
3333
with:
3434
repository: ${{ github.repository }}
3535
releases-only: true
@@ -60,21 +60,21 @@ jobs:
6060
ls -la nuspec/chocolatey/tools/
6161
6262
- name: Choco Downgrade
63-
uses: crazy-max/ghaction-chocolatey@v3
63+
uses: crazy-max/ghaction-chocolatey@2526f467ccbd337d307fe179959cabbeca0bc8c0 # v3.4.0
6464
with:
6565
args: install chocolatey --version=1.2.1 --allow-downgrade -y -r --no-progress
6666

6767
- name: Pack Release
68-
uses: crazy-max/ghaction-chocolatey@v3
68+
uses: crazy-max/ghaction-chocolatey@2526f467ccbd337d307fe179959cabbeca0bc8c0 # v3.4.0
6969
with:
7070
args: pack nuspec/chocolatey/okta-aws-cli.nuspec --outputdirectory nuspec/chocolatey
7171

7272
- name: Choco Upgrade
73-
uses: crazy-max/ghaction-chocolatey@v3
73+
uses: crazy-max/ghaction-chocolatey@2526f467ccbd337d307fe179959cabbeca0bc8c0 # v3.4.0
7474
with:
7575
args: upgrade chocolatey
7676

7777
- name: Upload Release
78-
uses: crazy-max/ghaction-chocolatey@v3
78+
uses: crazy-max/ghaction-chocolatey@2526f467ccbd337d307fe179959cabbeca0bc8c0 # v3.4.0
7979
with:
8080
args: push nuspec/chocolatey/okta-aws-cli.${{ steps.version.outputs.nuget }}.nupkg -s https://push.chocolatey.org/ -k ${{ secrets.CHOCO_API_KEY }}

internal/picker/picker.go

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -203,17 +203,11 @@ func (m Model) View() string {
203203

204204
if len(m.filtered) > m.maxVisible {
205205
half := m.maxVisible / 2
206-
start = m.cursor - half
207-
if start < 0 {
208-
start = 0
209-
}
206+
start = max(m.cursor-half, 0)
210207
end = start + m.maxVisible
211208
if end > len(m.filtered) {
212209
end = len(m.filtered)
213-
start = end - m.maxVisible
214-
if start < 0 {
215-
start = 0
216-
}
210+
start = max(end-m.maxVisible, 0)
217211
}
218212
}
219213

@@ -295,12 +289,10 @@ func (m Model) highlightMatchesSelected(match fuzzy.Match) string {
295289
return result.String()
296290
}
297291

298-
// Selected returns the selected item
299292
func (m Model) Selected() string {
300293
return m.selected
301294
}
302295

303-
// Cancelled returns true if the user cancelled
304296
func (m Model) Cancelled() bool {
305297
return m.cancelled
306298
}
@@ -334,10 +326,3 @@ func Pick(title string, items []string) (string, error) {
334326

335327
return result.Selected(), nil
336328
}
337-
338-
func min(a, b int) int {
339-
if a < b {
340-
return a
341-
}
342-
return b
343-
}

0 commit comments

Comments
 (0)