Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
cesaralarcondev authored Oct 12, 2024
2 parents 5769fe9 + c56e83b commit eeee0a1
Show file tree
Hide file tree
Showing 383 changed files with 22,529 additions and 368 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Code cleanup check

on:
push:
branches:
- main
pull_request:

jobs:
cleanup:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "14"

- name: Install dependencies
run: npm install glob

- name: Run cleanup script
run: node cleanup.js

- name: Check for uncommitted changes
id: git-check
run: echo "::set-output name=status::$(git status --porcelain)"

- name: Fail if changes are not committed
run: echo "::error::There are files to clean, please run `npm install && npm run clean` locally and commit the changes in your pull request"
if: steps.git-check.outputs.status != ''
9 changes: 9 additions & 0 deletions .github/workflows/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pull_request_rules:
- name: automatic merge for main when CI passes and 1 review
conditions:
- "#approved-reviews-by>=1"
- check-success=test
- base=main
actions:
merge:
method: merge
10 changes: 7 additions & 3 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ name: "Close stale issues and PRs"
on:
schedule:
- cron: "30 1 * * *"

jobs:
stale:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/stale@v7
with:
stale-issue-message: 'Este issue está obsoleto porque ha estado abierto 10 días sin actividad. Elimine la etiqueta o el comentario "stale" o se cerrará en 5 días.'
stale-pr-message: 'Este pull request está obsoleto porque ha estado abierto 10 días sin actividad. Elimine la etiqueta o el comentario "stale" o se cerrará en 5 días.'
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 10
days-before-close: 5
stale-pr-label: "stale"
stale-pr-message: '🚨🪨 Este pull request está obsoleto porque ha estado abierto durante 10 días sin actividad. Por favor, elimine la etiqueta o el comentario "stale" o se cerrará en un plazo de 5 días'

29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Run Jest tests

on:
push:
pull_request:
workflow_dispatch:
inputs:
pr_number:
description: 'Pull request number (optional)'
required: false

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test
46 changes: 46 additions & 0 deletions cleanup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const fs = require('fs');
const path = require('path');
const glob = require('glob');

// Define the target directories
const targetDirs = ["github-profiles"];

targetDirs.forEach(targetDir => {
if (fs.existsSync(targetDir)) {
const dirs = glob.sync(`${targetDir}/**/*.*`, { nodir: false });

// Rename folder names, replacing '.' with '(dot)'
dirs.forEach(dir => {
if (fs.lstatSync(dir).isDirectory()) {
const parentDir = path.dirname(dir);
const baseName = path.basename(dir);
const newName = baseName.replace('.', '(dot)');
const newPath = path.join(parentDir, newName);

if (dir !== newPath) {
fs.renameSync(dir, newPath);
}
}
});

// Delete files that match the .gitignore file
const gitignorePath = path.join(targetDir, '.gitignore');

if (fs.existsSync(gitignorePath)) {
const gitignore = fs.readFileSync(gitignorePath, 'utf-8');
const patterns = gitignore.split('\n').filter(pattern => pattern.trim() !== '');

patterns.forEach(pattern => {
const files = glob.sync(path.join(targetDir, pattern));

files.forEach(file => {
if (fs.existsSync(file)) {
fs.unlinkSync(file);
}
});
});
}
} else {
console.log(`The target directory "${targetDir}" does not exist. Please check the path.`);
}
});
62 changes: 62 additions & 0 deletions folders.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
const fs = require("fs");
const path = require("path");
const glob = require("glob");

const regularUsernameRegex = /(\w+|\(dot\))*/;
const discordUsernameRegex = /(\w+|\(dot\))*-\d{4}/;

// Define the array of folders and filenames to check
const foldersToCheck = [
{
name: "github-profiles",
filenames: ["index.html", "README.md", "**/*.css"],
},
];

// Define the array of folders to ignore
const foldersToIgnore = [".github", "node_modules", ".git"];

describe("Folder structure", () => {
foldersToCheck.forEach((folderToCheck) => {
// Get all folders in the current directory
const folders = fs.readdirSync(path.join(__dirname, folderToCheck.name));

folders.forEach((folder) => {
describe(`Check folder ${folderToCheck.name}/${folder}`, () => {
test(`name ${folder} is valid`, () => {
const usernameRegex = new RegExp(
`(${regularUsernameRegex.source})|(${discordUsernameRegex.source})`
);
expect(folder).toMatch(usernameRegex);
});

describe(`Check files in ${folderToCheck.name}/${folder}`, () => {
// Check if each file in the filenames array exists in the folder
folderToCheck.filenames.forEach((pattern) => {
const files = glob.sync(
path.join(__dirname, folderToCheck.name, folder, pattern),
{ nocase: false }
);
test(`file ${pattern} exists in ${folder}`, () => {
expect(files.length).toBeGreaterThan(0);
});
});
});
});
});
});

test("Check for unexpected folders", () => {
// Get all folders in the parent directory
const folders = fs.readdirSync(__dirname);

folders.forEach((folder) => {
// Check if the folder is either in foldersToCheck, foldersToIgnore, or is not a directory
const isExpectedFolder =
foldersToCheck.some((f) => f.name === folder) ||
foldersToIgnore.includes(folder) ||
!fs.lstatSync(path.join(__dirname, folder)).isDirectory();
expect(isExpectedFolder).toBe(true);
});
});
});
37 changes: 37 additions & 0 deletions github-profiles/7thalex-1191/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Hi, I'm Alexander Pinto 👋

I'm a **Frontend Development** student at **Undefined Academy**.
My goal is to be able to deliver high quality code that is **readable**, **maintainable** and **scalable**.

## Skills 🛠️

- React
- TypeScript
- HTML/CSS
- Git

## Contact me 📫

- [Github](https://github.com/alexpintodiaz) 🖥️
- [LinkedIn](https://www.linkedin.com/in/pintodiaz/) 💼
- [[email protected]](mailto:[email protected]) ✉️

## Terminal Commands 💥

| Command | Description |
| ------- | ------------------------------------------------- |
| ls | Lists the files in the current directory |
| cd | Allows us to navigate between folders |
| rm | Allows us to delete a folder given a path |
| mkdir | Creates a new folder given a name for that folder |
| touch | Creates a new file given a path and/or name |

## Alias Commands 👽️

| Alias Command | Description |
| ------------- | ----------- |
| cl | clear |
| npmd | npm run dev |
| npms | npm start |

**_Thanks for visiting my GitHub profile!_** 😊
102 changes: 102 additions & 0 deletions github-profiles/7thalex-1191/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="main.css" />
<title>Alexander Pinto CV</title>
</head>

<body>
<!-- Main section -->
<h1>Hi, I'm Alexander Pinto 👋</h1>
<p>
I'm a <strong>Frontend Development</strong> student at
<strong>Undefined Academy</strong>.
<br />
My goal is to be able to deliver high quality code that is
<strong>readable, maintainable and scalable</strong>.
</p>
<!-- Skills section -->
<h2>Skills 🛠️</h2>
<ul>
<li>React</li>
<li>TypeScript</li>
<li>HTML/CSS</li>
<li>Git</li>
</ul>
<!-- Contact section -->
<h2>Contact me 📫</h2>
<ul>
<li><a href="https://github.com/alexpintodiaz">Github</a></li>
<li><a href="https://www.linkedin.com/in/pintodiaz/">LinkedIn</a></li>
<li>
<a href="mailto:[email protected]"
>[email protected]</a
>
</li>
</ul>

<!-- Terminal commands section -->

<h2>Terminal Commands 💥</h2>

<table>
<thead>
<tr>
<th>Command</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ls</td>
<td>Lists the files in the current directory</td>
</tr>
<tr>
<td>cd</td>
<td>Allows us to navigate between folders</td>
</tr>
<tr>
<td>rm</td>
<td>Allows us to delete a folder given a path</td>
</tr>
<tr>
<td>mkdir</td>
<td>Creates a new folder given a name for that folder</td>
</tr>
<tr>
<td>touch</td>
<td>Creates a new file given a path and/or name</td>
</tr>
</tbody>
</table>

<!-- Alias commands section -->

<h2>Alias Commands 👽️</h2>

<table>
<thead>
<tr>
<th>Alias Command</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>cl</td>
<td>clear</td>
</tr>
<tr>
<td>npmd</td>

<td>npm run dev</td>
</tr>
<tr>
<td>npms</td>
<td>npm start</td>
</tr>
</tbody>
</table>
</body>
</html>
47 changes: 47 additions & 0 deletions github-profiles/7thalex-1191/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@import url("https://fonts.googleapis.com/css2?family=Golos+Text&family=Grand+Hotel&display=swap");

body {
background: #f3f4f6;
margin: 0 auto;
max-width: 50em;
font-family: "Golos Text", "Helvetica", "Arial", sans-serif;
line-height: 1.5;
padding: 4em 1em;
color: #566b78;
}

a {
color: #e81c4f;
}

h2 {
margin-top: 1em;
padding-top: 1em;
}

h1,
h2,
strong {
color: #333;
}

code,
pre {
background: #f5f7f9;
border-bottom: 1px solid #d8dee9;
color: #a7adba;
}

code {
padding: 2px 4px;
vertical-align: text-bottom;
}

pre {
padding: 1em;
border-left: 2px solid #69c;
}

th {
padding-right: 4rem;
}
Loading

0 comments on commit eeee0a1

Please sign in to comment.