Skip to content

Commit 239283a

Browse files
🩹[Patch]: Workflow improvements (#15)
This release makes several improvements and updates to GitHub Actions workflows, dependencies, and documentation. The main focus is on enhancing workflow security and maintainability by pinning action versions, updating configuration and naming, and improving documentation clarity. **Workflow and Action Updates:** * Updated all GitHub Actions in workflow files (such as `actions/checkout`, `actions/upload-artifact`, `super-linter/super-linter`, and `actions/download-artifact`) to use pinned commit SHAs for improved security and traceability. Also added `persist-credentials: false` to checkout steps. * Renamed `.github/workflows/Auto-Release.yml` to `.github/workflows/Release.yml`, updated job and workflow names, and changed the trigger from `pull_request_target` to `pull_request` with path filters for more precise release automation. * Replaced the `PSModule/Auto-Release` action with `PSModule/Release-GHRepository` for release management. **Configuration and Linting:** * Removed the `.github/linters/.jscpd.json` configuration file and disabled JSCPD validation in the linter workflow, streamlining linting checks. * Disabled several Prettier validations in the linter workflow for JSON, Markdown, and YAML files. **Dependency and Schedule Management:** * Changed the Dependabot update schedule from weekly to daily and added a cooldown period of 7 days between updates to balance update frequency. **Documentation Improvements:** * Fixed a typo in both `README.md` and `action.yml` to clarify that artifacts are "downloaded" (not "download") from workflow runs. * Updated the script path in `action.yml` from `scripts/main.ps1` to `src/main.ps1` for consistency with the repository structure.
1 parent 6790c45 commit 239283a

File tree

8 files changed

+31
-27
lines changed

8 files changed

+31
-27
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 & 10 deletions
This file was deleted.

‎.github/workflows/Action-Test.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ 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: Upload Artifact
29-
uses: actions/upload-artifact@v5
31+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
3032
with:
3133
name: Docs
3234
path: README.md
@@ -38,7 +40,9 @@ jobs:
3840
steps:
3941
# Need to check out as part of the test, as its a local action
4042
- name: Checkout repo
41-
uses: actions/checkout@v6
43+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
44+
with:
45+
persist-credentials: false
4246

4347
- name: Action-Test
4448
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 }}

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ As an example, terraform plans can be uploaded as artifacts in a PR CI workflow
1111
| - | - | - | - |
1212
| `Path` | The path to the artifact to download. | No | |
1313
| `WorkflowID` | The filename or ID of the workflow to download the artifact from. You must provide either `WorkflowID` or `WorkflowRunID`. | No | '' |
14-
| `WorkflowRunID` | The ID of the workflow run where the artifact will be download from. You must provide either `WorkflowID` or `WorkflowRunID`. | No | '' |
14+
| `WorkflowRunID` | The ID of the workflow run where the artifact will be downloaded from. You must provide either `WorkflowID` or `WorkflowRunID`. | No | '' |
1515
| `ArtifactName` | Name of the artifact to download. If unspecified, all artifacts for the run are downloaded. | Yes | |
1616
| `GITHUB_TOKEN` | The GitHub token used to authenticate with the GitHub API. | Yes | |
1717
| `WorkingDirectory` | The working directory where the artifact will be downloaded to. Default is the root of the repository. | No | `${{ github.workspace }}` |

‎action.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ inputs:
1515
default: ''
1616
WorkflowRunID:
1717
description: |
18-
The ID of the workflow run where the artifact will be download from.
18+
The ID of the workflow run where the artifact will be downloaded from.
1919
You must provide either `WorkflowID` or `WorkflowRunID`.
2020
required: false
2121
default: ''
@@ -43,10 +43,10 @@ runs:
4343
PSMODULE_DOWNLOAD_CIARTIFACT_INPUT_WorkflowRunID: ${{ inputs.WorkflowRunID }}
4444
run: |
4545
# Download-CIArtifact
46-
${{ github.action_path }}/scripts/main.ps1
46+
${{ github.action_path }}/src/main.ps1
4747
4848
- name: Download Artifact
49-
uses: actions/download-artifact@v6
49+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
5050
with:
5151
name: ${{ inputs.ArtifactName }}
5252
path: ${{ steps.workflow_run_id.outputs.Path }}
File renamed without changes.

0 commit comments

Comments
 (0)