Skip to content

Commit 17bb50e

Browse files
🩹[Patch]: Workflow improvements (#24)
This release focuses on updating and improving the project's GitHub Actions workflows and configuration files. The main goals are to enhance security and reliability by pinning action versions, streamline release and dependency management, and clean up unused or redundant configuration files. - Fixes #23 **Workflow and Action Updates:** * Updated all uses of `actions/checkout` to reference a specific commit hash (`de0fac2e4500dabe0009e67214ff5f5447ce83dd`) for improved security and reproducibility across workflows. * Replaced unpinned or generic action versions with commit-pinned versions for `PSModule/GitHub-Script`, `super-linter/super-linter`, and `PSModule/Invoke-Pester` to ensure consistent behavior and improve security. * Updated the linter workflow to use a pinned version of `super-linter` and added/adjusted validation environment variables. **Release and Dependency Management:** * Renamed `.github/workflows/Auto-Release.yml` to `.github/workflows/Release.yml`, updated the workflow name, and switched the trigger from `pull_request_target` to `pull_request` for better security. Also restricted the workflow to run only on changes to `action.yml` and `src/**`. * Replaced the use of `PSModule/Auto-Release` with `PSModule/Release-GHRepository` in the release workflow, and updated job names accordingly. * Changed the Dependabot update schedule from weekly to daily and added a cooldown period to manage update frequency. **Configuration Cleanup:** * Removed the `.github/linters/.jscpd.json` file and `.github/release.yml`, indicating a cleanup of unused or redundant configuration files. **Other Improvements:** * Fixed a typo in `README.md` for clarity. * Updated script paths in `action.yml` from `scripts/` to `src/` to reflect directory restructuring.
1 parent 0b13023 commit 17bb50e

File tree

12 files changed

+31
-54
lines changed

12 files changed

+31
-54
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ updates:
1111
- dependencies
1212
- github-actions
1313
schedule:
14-
interval: weekly
14+
interval: daily
15+
cooldown:
16+
default-days: 7

.github/linters/.jscpd.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/release.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/Action-Test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
Conclusion: ${{ steps.action-test.conclusion }}
2626
steps:
2727
- name: Checkout repo
28-
uses: actions/checkout@v6
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2929
with:
3030
persist-credentials: false
3131

@@ -50,7 +50,7 @@ jobs:
5050
Conclusion: ${{ steps.action-test.conclusion }}
5151
steps:
5252
- name: Checkout repo
53-
uses: actions/checkout@v6
53+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5454
with:
5555
persist-credentials: false
5656

@@ -76,7 +76,7 @@ jobs:
7676
Conclusion: ${{ steps.action-test.conclusion }}
7777
steps:
7878
- name: Checkout repo
79-
uses: actions/checkout@v6
79+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8080
with:
8181
persist-credentials: false
8282

@@ -103,7 +103,7 @@ jobs:
103103
Conclusion: ${{ steps.action-test.conclusion }}
104104
steps:
105105
- name: Checkout repo
106-
uses: actions/checkout@v6
106+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
107107
with:
108108
persist-credentials: false
109109

@@ -129,7 +129,7 @@ jobs:
129129
Conclusion: ${{ steps.action-test.conclusion }}
130130
steps:
131131
- name: Checkout repo
132-
uses: actions/checkout@v6
132+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
133133
with:
134134
persist-credentials: false
135135

@@ -169,11 +169,11 @@ jobs:
169169
OutputsConclusion: ${{ needs.ActionTestOutputs.outputs.Conclusion }}
170170
steps:
171171
- name: Checkout repo
172-
uses: actions/checkout@v6
172+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
173173
with:
174174
persist-credentials: false
175175

176176
- name: Aggregated Status
177-
uses: PSModule/Github-Script@v1
177+
uses: PSModule/GitHub-Script@0097f3bbe3f413f3b577b9bcc600727b0ca3201a # v1.7.10
178178
with:
179179
Script: tests/Get-AggregatedStatus.ps1

.github/workflows/Linter.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,20 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout repo
22-
uses: actions/checkout@v6
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2323
with:
2424
persist-credentials: false
2525
fetch-depth: 0
2626

2727
- name: Lint code base
28-
uses: super-linter/super-linter@latest
28+
uses: super-linter/super-linter@d5b0a2ab116623730dd094f15ddc1b6b25bf7b99 # v8.3.2
2929
env:
3030
GITHUB_TOKEN: ${{ github.token }}
31-
VALIDATE_JSON_PRETTIER: false
32-
VALIDATE_MARKDOWN_PRETTIER: false
33-
VALIDATE_YAML_PRETTIER: false
3431
VALIDATE_BIOME_FORMAT: false
3532
VALIDATE_BIOME_LINT: false
3633
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false
34+
VALIDATE_JSCPD: false
35+
VALIDATE_JSON_PRETTIER: false
36+
VALIDATE_MARKDOWN_PRETTIER: false
37+
VALIDATE_YAML_PRETTIER: false
3738
FILTER_REGEX_EXCLUDE: '.*Set-PSModuleTest\.ps1$'
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: Auto-Release
1+
name: Release
22

3-
run-name: "Auto-Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
3+
run-name: "Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
44

55
on:
6-
pull_request_target:
6+
pull_request:
77
branches:
88
- main
99
types:
@@ -12,6 +12,9 @@ on:
1212
- reopened
1313
- synchronize
1414
- labeled
15+
paths:
16+
- 'action.yml'
17+
- 'src/**'
1518

1619
concurrency:
1720
group: ${{ github.workflow }}-${{ github.ref }}
@@ -22,15 +25,15 @@ permissions:
2225
pull-requests: write
2326

2427
jobs:
25-
Auto-Release:
28+
Release:
2629
runs-on: ubuntu-latest
2730
steps:
2831
- name: Checkout Code
29-
uses: actions/checkout@v6
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3033
with:
3134
persist-credentials: false
3235

33-
- name: Auto-Release
34-
uses: PSModule/Auto-Release@v1
36+
- name: Release
37+
uses: PSModule/Release-GHRepository@88c70461c8f16cc09682005bcf3b7fca4dd8dc1a # v2.0.1
3538
with:
3639
IncrementalPrerelease: false

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ The action provides the following outputs:
136136
To be clear; the action follows the settings file to determine which rules to skip.
137137

138138
4. **View the Results**
139-
The action outputs the results of the tests to goth logs and step summary. If the tests pass, the actions `outcome` will be `success`.
139+
The action outputs the results of the tests to both logs and step summary. If the tests pass, the actions `outcome` will be `success`.
140140
If the tests fail, the actions outcome will be `failure`. To make the workflow continue even if the tests fail, you can set the
141141
`continue-on-error` option to `true`. Use this built-in feature to stop the workflow from failing so that you can aggregate the status of tests
142142
across multiple jobs.

action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ runs:
248248
using: composite
249249
steps:
250250
- name: Get-TestPaths
251-
uses: PSModule/Github-Script@v1
251+
uses: PSModule/GitHub-Script@0097f3bbe3f413f3b577b9bcc600727b0ca3201a # v1.7.10
252252
id: paths
253253
env:
254254
PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_Path: ${{ inputs.Path }}
@@ -259,10 +259,10 @@ runs:
259259
Verbose: ${{ inputs.Verbose }}
260260
Version: ${{ inputs.Version }}
261261
WorkingDirectory: ${{ inputs.WorkingDirectory }}
262-
Script: ${{ github.action_path }}/scripts/main.ps1
262+
Script: ${{ github.action_path }}/src/main.ps1
263263

264264
- name: Invoke-Pester
265-
uses: PSModule/Invoke-Pester@v4
265+
uses: PSModule/Invoke-Pester@1fcb663c0efe914e8374d78e16aa7bb907ea2434 # v4.2.3
266266
id: test
267267
env:
268268
SettingsFilePath: ${{ fromJson(steps.paths.outputs.result).SettingsFilePath }}
@@ -273,7 +273,7 @@ runs:
273273
Version: ${{ inputs.Version }}
274274
WorkingDirectory: ${{ inputs.WorkingDirectory }}
275275
TestResult_TestSuiteName: ${{ inputs.TestResult_TestSuiteName }}
276-
Path: ${{ github.action_path }}/scripts/tests/PSScriptAnalyzer
276+
Path: ${{ github.action_path }}/src/tests/PSScriptAnalyzer
277277
Run_Path: ${{ fromJson(steps.paths.outputs.result).CodePath }}
278278
ReportAsJson: ${{ inputs.ReportAsJson }}
279279
Notice_Mode: ${{ inputs.Notice_Mode }}
File renamed without changes.

scripts/tests/PSScriptAnalyzer/PSScriptAnalyzer.Configuration.ps1 renamed to src/tests/PSScriptAnalyzer/PSScriptAnalyzer.Configuration.ps1

File renamed without changes.

0 commit comments

Comments
 (0)