Skip to content

Commit abc6815

Browse files
committed
retry #14
1 parent c21280b commit abc6815

File tree

2 files changed

+4
-33
lines changed

2 files changed

+4
-33
lines changed

.github/workflows/check-chains.yml

+3-19
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,20 @@ jobs:
2727
working-directory: ./scripts
2828
run: node --loader ts-node/esm checkChains.mts
2929

30-
- name: Debug - List files
31-
run: |
32-
echo "Root directory:"
33-
ls -la
34-
echo "Scripts directory:"
35-
ls -la scripts/
36-
3730
- name: Check if report exists
3831
id: check_report
32+
working-directory: ./scripts
3933
run: |
40-
echo "Checking for report in root:"
4134
if [ -f report ]; then
42-
echo "Report exists in root"
43-
echo "exists=true" >> $GITHUB_OUTPUT
44-
elif [ -f scripts/report ]; then
45-
echo "Report exists in scripts directory"
4635
echo "exists=true" >> $GITHUB_OUTPUT
47-
cp scripts/report report
4836
else
49-
echo "Report not found in either location"
5037
echo "exists=false" >> $GITHUB_OUTPUT
5138
fi
5239
5340
- name: Read report content
5441
id: get_report
5542
if: ${{ steps.check_report.outputs.exists == 'true' }}
5643
run: |
57-
echo "Reading report content:"
58-
cat report
5944
echo "report<<EOF" >> $GITHUB_OUTPUT
6045
cat report >> $GITHUB_OUTPUT
6146
echo "EOF" >> $GITHUB_OUTPUT
@@ -65,20 +50,19 @@ jobs:
6550
uses: actions/github-script@v6
6651
with:
6752
script: |
68-
console.log('Creating issue with report:', process.env.REPORT);
53+
// Format the current date as DD-MM-YYYY
6954
const now = new Date();
7055
const day = String(now.getDate()).padStart(2, '0');
7156
const month = String(now.getMonth() + 1).padStart(2, '0');
7257
const year = now.getFullYear();
7358
const formattedDate = `${day}-${month}-${year}`;
7459
const report = process.env.REPORT;
7560
const issueTitle = `Chain Issues Report (${formattedDate})`;
76-
await github.rest.issues.create({
61+
github.issues.create({
7762
owner: context.repo.owner,
7863
repo: context.repo.repo,
7964
title: issueTitle,
8065
body: report,
8166
});
82-
console.log('Issue created successfully');
8367
env:
8468
REPORT: ${{ steps.get_report.outputs.report }}

scripts/checkChains.mts

+1-14
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ async function checkUrl(url: string): Promise<string | null> {
179179
return `URL is unreachable (${url})`;
180180
}
181181

182-
// Main function: iterate over chains and record broken URLs
182+
// // Main function: iterate over chains and record broken URLs
183183
// async function checkChains(): Promise<void> {
184184
// const entries: [string, ChainData][] = Object.entries(chains);
185185
// const totalChains = entries.length;
@@ -231,8 +231,6 @@ async function checkUrl(url: string): Promise<string | null> {
231231
// }
232232

233233
async function checkChains(): Promise<void> {
234-
console.log('Starting test report creation...');
235-
236234
const testReport = `
237235
**Test Chain (test-chain)**
238236
- Website: Test issue with website
@@ -243,22 +241,11 @@ async function checkChains(): Promise<void> {
243241
`;
244242

245243
try {
246-
console.log('Creating test report file...');
247-
// Пробуем записать в разные места, чтобы понять, где работает
248244
fs.writeFileSync('./report', testReport);
249-
console.log('Report was written to ./report');
250-
fs.writeFileSync('../report', testReport);
251-
console.log('Report was written to ../report');
252245
} catch (error) {
253246
console.error('Error writing report file:', error);
254247
throw error;
255248
}
256-
257-
// Выведем содержимое директории для проверки
258-
console.log('Current directory contents:');
259-
console.log(fs.readdirSync('.'));
260-
console.log('Parent directory contents:');
261-
console.log(fs.readdirSync('..'));
262249
}
263250

264251
checkChains().catch(console.error);

0 commit comments

Comments
 (0)