Skip to content

Commit 2e7993f

Browse files
committed
ci: update
1 parent d8dee07 commit 2e7993f

File tree

1 file changed

+9
-38
lines changed

1 file changed

+9
-38
lines changed

.github/workflows/pr-autoscan.yml

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,13 @@ env:
5555
# ---------------------------------------------------------------------------------------
5656

5757
jobs:
58-
autocheck-validation:
58+
pr-autoscan:
5959
runs-on: ubuntu-latest
6060
permissions:
61-
id-token: write
6261
contents: read
6362
actions: read
6463
issues: write
65-
pull-requests: write
64+
pull-requests: read
6665

6766
steps:
6867

@@ -72,38 +71,6 @@ jobs:
7271
# however this isnt available for 'issue_comment'
7372
# ---------------------------------------------------------------------------------------
7473

75-
- name: 🏷️ Verify Existing Labels
76-
uses: actions/github-script@v7
77-
with:
78-
github-token: ${{ secrets.ADMINSERV_TOKEN_CL || github.token }}
79-
script: |
80-
const labels = JSON.parse( process.env.LABELS_JSON );
81-
for ( const label of labels )
82-
{
83-
try
84-
{
85-
await github.rest.issues.createLabel(
86-
{
87-
owner: context.repo.owner,
88-
repo: context.repo.repo,
89-
name: label.name,
90-
description: label.description || '',
91-
color: label.color
92-
});
93-
}
94-
catch ( err )
95-
{
96-
if ( err.status === 422 )
97-
{
98-
console.log( `Label '${label.name}' already exists. Skipping.` );
99-
}
100-
else
101-
{
102-
console.error( `Error creating label '${label.name}': ${err}` );
103-
}
104-
}
105-
}
106-
10774
- name: 🏷️ Verify Existing Labels
10875
uses: actions/github-script@v7
10976
with:
@@ -143,7 +110,7 @@ jobs:
143110
- uses: actions/github-script@v7
144111
id: autocheck-get-issue-number
145112
with:
146-
github-token: ${{ secrets.ADMINSERV_TOKEN_CL }}
113+
github-token: ${{ secrets.ADMINSERV_TOKEN_CL || github.token }}
147114
script: |
148115
if ( context.issue.number )
149116
{
@@ -176,7 +143,7 @@ jobs:
176143
# ---------------------------------------------------------------------------------------
177144

178145
- uses: actions/checkout@v4
179-
if: ( github.event_name == 'pull_request' ) || ( github.event_name == 'issue_comment' && contains( github.event.comment.html_url, '/pull/' ) && contains( github.event.comment.body, '/rescan' ) )
146+
if: ( github.event_name == 'pull_request_target' ) || ( github.event_name == 'pull_request' ) || ( github.event_name == 'issue_comment' && contains( github.event.comment.html_url, '/pull/' ) && contains( github.event.comment.body, '/rescan' ) )
180147
with:
181148
fetch-depth: 0
182149
ref: "refs/pull/${{ steps.autocheck-get-issue-number.outputs.result }}/merge"
@@ -219,6 +186,10 @@ jobs:
219186
COUNT_RENAMED: ${{ steps.autocheck-get-changed-files.outputs.renamed_files_count }}
220187
COUNT_COPIED: ${{ steps.autocheck-get-changed-files.outputs.copied_files_count }}
221188

189+
- name: List Directories
190+
run: |
191+
ls
192+
222193
# ---------------------------------------------------------------------------------------
223194
# Run autocheck
224195
# ---------------------------------------------------------------------------------------
@@ -227,7 +198,7 @@ jobs:
227198
id: autocheck-run
228199
uses: actions/github-script@v7
229200
with:
230-
github-token: ${{ secrets.ADMINSERV_TOKEN_CL }}
201+
github-token: ${{ secrets.ADMINSERV_TOKEN_CL || github.token }}
231202
script: |
232203
const fs = require( 'fs' );
233204
const escape_html = ( unsafe ) => unsafe.replace( /&/g, '&amp;' ).replace( /</g, '&lt;' ).replace( />/g, '&gt;' ).replace( /"/g, '&quot;' ).replace( /'/g, '&#039;' );

0 commit comments

Comments
 (0)