Skip to content

Commit ed79b6e

Browse files
🩹[Patch]: Workflow improvements (#9)
This release updates and improves several aspects of the project's GitHub Actions workflows and related configuration files. The main changes include refactoring the release workflow for clarity and security, updating dependencies and action versions to use specific commit SHAs, and cleaning up unused or redundant configuration files. **Workflow and CI/CD Improvements:** * Renamed `.github/workflows/Auto-Release.yml` to `.github/workflows/Release.yml`, updated its trigger to `pull_request` (instead of `pull_request_target`), restricted its scope to changes in `action.yml` and `src/**`, and changed the main job and step names from `Auto-Release` to `Release`. Also replaced the action used for releases to `PSModule/Release-GHRepository@88c70461c8f16cc09682005bcf3b7fca4dd8dc1a` and updated the checkout action to a specific SHA with credentials disabled for improved security. * Updated the `Action-Test` and `Linter` workflows to use specific commit SHAs for the `actions/checkout` and `super-linter/super-linter` actions, and set `persist-credentials: false` for security. Also, in the `Linter` workflow, disabled some validators and set additional environment variables. **Dependency and Automation Configuration:** * Changed the Dependabot update schedule from weekly to daily and added a cooldown period of 7 days between updates. **Configuration Cleanup:** * Removed the `.github/linters/.jscpd.json` file, which is no longer needed. * Removed the `.github/release.yml` configuration for automatically generated release notes, as this is now handled by the updated release workflow. **Other Notable Changes:** * Updated the `action.yml` to reference the new script location at `src/main.ps1` instead of `scripts/main.ps1`.
1 parent d60d63e commit ed79b6e

File tree

11 files changed

+24
-41
lines changed

11 files changed

+24
-41
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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ 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
- name: Action-Test
2931
uses: ./

.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
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,13 +25,15 @@ permissions:
2225
pull-requests: write # Required to create comments on the PRs
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
33+
with:
34+
persist-credentials: false
3035

31-
- name: Auto-Release
32-
uses: PSModule/Auto-Release@v1
36+
- name: Release
37+
uses: PSModule/Release-GHRepository@88c70461c8f16cc09682005bcf3b7fca4dd8dc1a # v2.0.1
3338
env:
3439
GITHUB_TOKEN: ${{ github.token }}

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ runs:
1212
shell: pwsh
1313
run: |
1414
# Install-PSModuleHelpers
15-
${{ github.action_path }}/scripts/main.ps1
15+
${{ github.action_path }}/src/main.ps1
File renamed without changes.

0 commit comments

Comments
 (0)