@@ -27,35 +27,20 @@ jobs:
27
27
working-directory : ./scripts
28
28
run : node --loader ts-node/esm checkChains.mts
29
29
30
- - name : Debug - List files
31
- run : |
32
- echo "Root directory:"
33
- ls -la
34
- echo "Scripts directory:"
35
- ls -la scripts/
36
-
37
30
- name : Check if report exists
38
31
id : check_report
32
+ working-directory : ./scripts
39
33
run : |
40
- echo "Checking for report in root:"
41
34
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"
46
35
echo "exists=true" >> $GITHUB_OUTPUT
47
- cp scripts/report report
48
36
else
49
- echo "Report not found in either location"
50
37
echo "exists=false" >> $GITHUB_OUTPUT
51
38
fi
52
39
53
40
- name : Read report content
54
41
id : get_report
55
42
if : ${{ steps.check_report.outputs.exists == 'true' }}
56
43
run : |
57
- echo "Reading report content:"
58
- cat report
59
44
echo "report<<EOF" >> $GITHUB_OUTPUT
60
45
cat report >> $GITHUB_OUTPUT
61
46
echo "EOF" >> $GITHUB_OUTPUT
@@ -65,20 +50,19 @@ jobs:
65
50
uses : actions/github-script@v6
66
51
with :
67
52
script : |
68
- console.log('Creating issue with report:', process.env.REPORT);
53
+ // Format the current date as DD-MM-YYYY
69
54
const now = new Date();
70
55
const day = String(now.getDate()).padStart(2, '0');
71
56
const month = String(now.getMonth() + 1).padStart(2, '0');
72
57
const year = now.getFullYear();
73
58
const formattedDate = `${day}-${month}-${year}`;
74
59
const report = process.env.REPORT;
75
60
const issueTitle = `Chain Issues Report (${formattedDate})`;
76
- await github.rest .issues.create({
61
+ github.issues.create({
77
62
owner: context.repo.owner,
78
63
repo: context.repo.repo,
79
64
title: issueTitle,
80
65
body: report,
81
66
});
82
- console.log('Issue created successfully');
83
67
env :
84
68
REPORT : ${{ steps.get_report.outputs.report }}
0 commit comments