Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: node test.js
10 changes: 0 additions & 10 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@
<meta name="description" content="An archive of hackathons from around the world (2014-2025).">
<meta name="keywords" content="hackathon, hackathons, list">
<link rel="shortcut icon" href="/images/favicon.ico" />
<!-- Start Google Javascript -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-51284668-3', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
<link rel="stylesheet" type="text/css" href="css/skeleton.css">
<link rel="stylesheet" href="css/style.css">
</head>
Expand Down
12 changes: 1 addition & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="An archive of hackathons from around the world (2014-2025).">
<meta name="keywords" content="hackathon, hackathons, list, directory">
<!-- Start Google Javascript -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-51284668-3', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
<link rel="shortcut icon" href="images/favicon.ico" />
<link rel="stylesheet" type="text/css" href="css/skeleton.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
Expand Down Expand Up @@ -217,6 +207,6 @@ <h2>{{hackathon.title}}</h2>
</div>
</body>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.3/angular.min.js"></script>
<script src="js/app.js"></script>
</html>
10 changes: 9 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,16 @@ for (const year of years) {
let lastHackathon;

for (const hackathon of obj[monthName]) {
// Validate URL fields don't use dangerous schemes (e.g. javascript:)
for (const field of ['url', 'facebookURL', 'twitterURL']) {
const val = (hackathon[field] || '').trim();
if (val && /^[a-z][a-z0-9+.-]*:/i.test(val) && !/^https?:/i.test(val)) {
bail(`${hackathon.title} has unsafe ${field}: ${val}`);
}
}

let startDate = Date.parse(hackathon.startDate);
if (startDate !== undefined) {
if (!isNaN(startDate)) {
if (lastStartDate > startDate) {
bail(`${hackathon.title} should be before ${lastHackathon.title}`);
}
Comment on lines 55 to 59
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Date.parse() returns NaN for invalid/missing dates, and lastStartDate is still updated later even when startDate is NaN. If a single entry has an unparseable startDate, subsequent chronological validation will silently stop working because lastStartDate becomes NaN and comparisons always fail. Consider only updating lastStartDate/lastHackathon when startDate is a valid number (or handle invalid dates explicitly).

Copilot uses AI. Check for mistakes.
Expand Down
Loading