Skip to content

Commit 883e327

Browse files
committed
Revert PythonBot workflow and script to original version to restore stability
Signed-off-by: Abhijeet Saharan <abhijeetsaharan2236@gmail.com>
1 parent 318b86b commit 883e327

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/scripts/bot-workflows.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ const REPO = process.env.REPO || process.env.GITHUB_REPOSITORY || '';
112112
let DRY_RUN = normaliseDryRun(process.env.DRY_RUN || '1');
113113
let PR_NUMBER = process.env.PR_NUMBER || '';
114114

115+
// Validate workflow name contains only safe characters
116+
if (FAILED_WORKFLOW_NAME && !/^[\w\s\-\.]+$/.test(FAILED_WORKFLOW_NAME)) {
117+
console.error(`ERROR: FAILED_WORKFLOW_NAME contains invalid characters: ${FAILED_WORKFLOW_NAME}`);
118+
process.exit(1);
119+
}
120+
115121
// Set GH_TOKEN environment variable for gh CLI
116122
if (GH_TOKEN) {
117123
process.env.GH_TOKEN = GH_TOKEN;
@@ -335,4 +341,4 @@ if (DRY_RUN === 1) {
335341
console.log('------------------------------------------------------------');
336342
console.log(' Workflow Failure Notifier Complete');
337343
console.log(` DRY_RUN: ${DRY_RUN}`);
338-
console.log('------------------------------------------------------------');
344+
console.log('------------------------------------------------------------');

.github/workflows/bot-workflows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ jobs:
3535
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.dry_run == 'true' && '1' || '0') || '0' }}
3636
steps:
3737
- name: Harden the runner (Audit all outbound calls)
38-
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
38+
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
3939
with:
4040
egress-policy: audit
4141

4242
- name: Checkout repository
4343
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4444

4545
- name: Setup Node.js
46-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
46+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4747
with:
4848
node-version: '20'
49-
49+
5050
- name: Notify PR of workflow failure
5151
if: github.event_name != 'workflow_dispatch' || github.event.inputs.failed_run_id != ''
5252
env:

0 commit comments

Comments
 (0)