Skip to content

Commit 1c3fcb0

Browse files
🩹 [Patch]: Update Action-Test workflow to create a unique lint branch for staging changes
1 parent 4d068ff commit 1c3fcb0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,17 @@ jobs:
4848

4949
- name: Get changes
5050
uses: PSModule/GitHub-Script@v1
51+
id: get-lint-branch
5152
with:
5253
Script: |
5354
LogGroup 'List files' {
5455
Get-ChildItem -Recurse -File | Select-Object -ExpandProperty FullName | Sort-Object
5556
}
56-
LogGroup 'Create lint branch' {
57-
git checkout -b lint
57+
$random = Get-Random -Minimum 1000 -Maximum 9999
58+
$branch = "lint-$random"
59+
Set-GitHubOutput -Name lintBranch -Value $branch
60+
LogGroup "Create $branch branch" {
61+
git checkout -b $branch
5862
}
5963
LogGroup 'Commit changes for linting' {
6064
git add .
@@ -68,6 +72,6 @@ jobs:
6872
uses: super-linter/super-linter/slim@7bba2eeb89d01dc9bfd93c497477a57e72c83240 # v8.2.0
6973
env:
7074
GITHUB_TOKEN: ${{ github.token }}
71-
DEFAULT_BRANCH: lint
75+
DEFAULT_BRANCH: ${{ fromJson(steps.get-lint-branch.outputs.result).lintBranch }}
7276
VALIDATE_MARKDOWN: true
7377
VALIDATE_NATURAL_LANGUAGE: true

0 commit comments

Comments
 (0)