Skip to content

Commit 6163879

Browse files
🩹[Patch]: Workflows improvements (#11)
This release primarily updates and improves the project's GitHub Actions workflows and configuration files. The changes focus on increasing security and maintainability by pinning action versions, updating release processes, and cleaning up unnecessary configuration files. There are also minor documentation and description corrections. **GitHub Actions and Workflow Improvements:** * Updated all GitHub Actions in workflow files (such as `Action-Test.yml` and `Linter.yml`) to use pinned commit SHAs instead of floating version tags, improving security and reproducibility. Also set `persist-credentials: false` for checkout steps to reduce risk. * Replaced the deprecated `.github/workflows/Auto-Release.yml` with a new `.github/workflows/Release.yml` workflow that triggers on pull requests to `main` and uses the `PSModule/Release-GHRepository` action, ensuring a more robust and targeted release process. * Updated the schedule for Dependabot updates from weekly to daily and introduced a cooldown period to better manage dependency update frequency. **Configuration and Linting:** * Removed the `.github/linters/.jscpd.json` configuration file and disabled JSCPD validation in the linter workflow, simplifying the linting setup. * Updated linter workflow to use a pinned version of `super-linter` and disabled certain validations for more control and consistency. **Release and Documentation Updates:** * Removed the `.github/release.yml` configuration for automatic release note categorization, streamlining release management. * Fixed a typo in the `description` field of `action.yml` and updated script paths and action versions for better clarity and maintainability.
1 parent 0c1d8cd commit 6163879

9 files changed

Lines changed: 57 additions & 73 deletions

File tree

.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 & 10 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: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,43 +23,45 @@ jobs:
2323
steps:
2424
# Need to check out as part of the test, as its a local action
2525
- name: Checkout repo
26-
uses: actions/checkout@v6
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
with:
28+
persist-credentials: false
2729

2830
# Upload artifact from tests:
2931
- name: Upload artifact [PATH-Windows-TestResults]
30-
uses: actions/upload-artifact@v5
32+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
3133
with:
3234
name: PATH-Windows-TestResults
3335
path: ./tests/TestResults/PATH-Windows-TestResults
3436
retention-days: 1
3537
if-no-files-found: error
3638

3739
- name: Upload artifact [PSModuleLint-Module-Windows-TestResults]
38-
uses: actions/upload-artifact@v5
40+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
3941
with:
4042
name: PSModuleLint-Module-Windows-TestResults
4143
path: ./tests/TestResults/PSModuleLint-Module-Windows-TestResults
4244
retention-days: 1
4345
if-no-files-found: error
4446

4547
- name: Upload artifact [PSModuleLint-SourceCode-Windows-TestResults]
46-
uses: actions/upload-artifact@v5
48+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
4749
with:
4850
name: PSModuleLint-SourceCode-Windows-TestResults
4951
path: ./tests/TestResults/PSModuleLint-SourceCode-Windows-TestResults
5052
retention-days: 1
5153
if-no-files-found: error
5254

5355
- name: Upload artifact [PSModuleTest-Module-Windows-TestResults]
54-
uses: actions/upload-artifact@v5
56+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
5557
with:
5658
name: PSModuleTest-Module-Windows-TestResults
5759
path: ./tests/TestResults/PSModuleTest-Module-Windows-TestResults
5860
retention-days: 1
5961
if-no-files-found: error
6062

6163
- name: Upload artifact [PSModuleTest-SourceCode-Windows-TestResults]
62-
uses: actions/upload-artifact@v5
64+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
6365
with:
6466
name: PSModuleTest-SourceCode-Windows-TestResults
6567
path: ./tests/TestResults/PSModuleTest-SourceCode-Windows-TestResults

.github/workflows/Auto-Release.yml

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

.github/workflows/Linter.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ 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
fetch-depth: 0
25+
persist-credentials: false
2526

2627
- name: Lint code base
27-
uses: super-linter/super-linter@latest
28+
uses: super-linter/super-linter@d5b0a2ab116623730dd094f15ddc1b6b25bf7b99 # v8.3.2
2829
env:
2930
GITHUB_TOKEN: ${{ github.token }}
31+
VALIDATE_BIOME_FORMAT: false
32+
VALIDATE_JSCPD: false
3033
VALIDATE_JSON_PRETTIER: false
3134
VALIDATE_MARKDOWN_PRETTIER: false
3235
VALIDATE_YAML_PRETTIER: false

.github/workflows/Release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release
2+
3+
run-name: "Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- main
9+
types:
10+
- closed
11+
- opened
12+
- reopened
13+
- synchronize
14+
- labeled
15+
paths:
16+
- 'action.yml'
17+
- 'src/**'
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: write # Required to create releases
25+
pull-requests: write # Required to create comments on the PRs
26+
27+
jobs:
28+
Release:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout Code
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
33+
with:
34+
persist-credentials: false
35+
36+
- name: Release
37+
uses: PSModule/Release-GHRepository@88c70461c8f16cc09682005bcf3b7fca4dd8dc1a # v2.0.1
38+

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Get-PesterTestResults
2-
description: A GitHub Action that is used to gather testreulst for the PSModule process.
2+
description: A GitHub Action that is used to gather test results for the PSModule process.
33
author: PSModule
44
branding:
55
icon: upload-cloud
@@ -39,7 +39,7 @@ runs:
3939
using: composite
4040
steps:
4141
- name: Get-PesterTestResults
42-
uses: PSModule/GitHub-Script@v1
42+
uses: PSModule/GitHub-Script@0097f3bbe3f413f3b577b9bcc600727b0ca3201a # v1.7.10
4343
env:
4444
PSMODULE_GET_PESTERTESTRESULTS_INPUT_SourceCodeTestSuites: ${{ inputs.SourceCodeTestSuites }}
4545
PSMODULE_GET_PESTERTESTRESULTS_INPUT_PSModuleTestSuites: ${{ inputs.PSModuleTestSuites }}
@@ -53,4 +53,4 @@ runs:
5353
WorkingDirectory: ${{ inputs.WorkingDirectory }}
5454
ShowInfo: false
5555
Script: |
56-
${{ github.action_path }}/scripts/main.ps1
56+
${{ github.action_path }}/src/main.ps1
File renamed without changes.

0 commit comments

Comments
 (0)