Skip to content
Merged

Test #38

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
26c4f36
Merge pull request #6 from MIbnEKhalid/ibnekhalid
MIbnEKhalid Apr 5, 2025
7d31d1d
Merge pull request #10 from MIbnEKhalid/Test
MIbnEKhalid Apr 7, 2025
b287837
Update login.handlebars
MIbnEKhalid Apr 8, 2025
fb806df
Update login.handlebars
MIbnEKhalid Apr 8, 2025
dcd644c
Create webpack.yml
MIbnEKhalid Apr 8, 2025
81834e2
Delete .github/workflows directory
MIbnEKhalid Apr 8, 2025
6f32d70
Create codeql.yml
MIbnEKhalid Apr 8, 2025
75dac88
Create node.js.yml
MIbnEKhalid Apr 8, 2025
bfb8d84
Merge pull request #14 from MIbnEKhalid/Test
MIbnEKhalid Apr 8, 2025
a521c72
Delete .github/workflows/node.js.yml
MIbnEKhalid Apr 8, 2025
43f30dc
Merge pull request #21 from MIbnEKhalid/Test
MIbnEKhalid Apr 8, 2025
9660125
Create autoMerge.yml
MIbnEKhalid Apr 9, 2025
1e461bb
Merge pull request #24 from MIbnEKhalid/Test
MIbnEKhalid Apr 9, 2025
d4eb712
Merge pull request #27 from MIbnEKhalid/Test
MIbnEKhalid Apr 9, 2025
ee3dfe2
Merge pull request #31 from MIbnEKhalid/Test
MIbnEKhalid Apr 10, 2025
92c7ae9
Merge pull request #34 from MIbnEKhalid/Test
MIbnEKhalid Apr 10, 2025
250f661
feat: Enhance authentication and session management
MIbnEKhalid Apr 11, 2025
8da7f13
Merge pull request #35 from MIbnEKhalid/maaz
42Wor Apr 11, 2025
bc1dca8
Refactor authentication and session management
MIbnEKhalid Apr 12, 2025
7183b92
Merge branch 'main' into ibnekhalid
MIbnEKhalid Apr 12, 2025
7da26cd
Merge branch 'Test' into ibnekhalid
MIbnEKhalid Apr 12, 2025
7f9c7e3
Merge pull request #37 from MIbnEKhalid/ibnekhalid
MIbnEKhalid Apr 12, 2025
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
64 changes: 64 additions & 0 deletions .github/workflows/autoMerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Auto Merge Test Branch to Main

on:
push:
branches:
- test # Trigger on push to the test branch only
paths:
- 'test/*' # Trigger only when files in the test branch are updated

jobs:
automerge:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Check for merge to test
id: check_merge
run: |
# Check if a merge was just made into the test branch
git fetch origin
target_branch=$(git rev-parse --abbrev-ref HEAD)
if [[ "$target_branch" == "test" ]]; then
echo "::set-output name=merge_to_test::true"
else
echo "::set-output name=merge_to_test::false"
fi

- name: Check for Conflicts
if: steps.check_merge.outputs.merge_to_test == 'true'
run: |
git fetch origin
git diff --check origin/main test

- name: Merge Test into Main
if: steps.check_merge.outputs.merge_to_test == 'true' && steps.Check_for_Conflicts.outcome == 'success'
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git checkout main
git merge --no-ff -m "Automatically merged test branch (from merge)" test
# Check for conflicts before pushing
git status

- name: Resolve Conflicts (Optional but crucial)
if: steps.check_merge.outputs.merge_to_test == 'true' && steps.Check_for_Conflicts.outcome == 'failure'
run: |
echo "Merge conflict detected! Please resolve conflicts manually."
# Insert code to attempt conflict resolution, if possible
# Using a tool like `jq` or `sed` or another more advanced method
# Example for a simple conflict on a JSON file
# (replace with your appropriate logic)

# if [[ $(git status | grep "error") ]]; then
# echo "Conflicts still exist after conflict handling!"
# exit 1
# fi


- name: Commit and Push Changes
if: steps.check_merge.outputs.merge_to_test == 'true' && steps.Check_for_Conflicts.outcome == 'success'
run: |
git push origin main

98 changes: 98 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '37 0 * * 5'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Handlebars from "handlebars";
import minifyHTML from "express-minify-html";
import minify from "express-minify";
import compression from "compression";
import mbkAuthRouter from "mbkauth";
import mbkAuthRouter from "mbkauthe";

dotenv.config();
const app = express();
Expand Down Expand Up @@ -98,6 +98,8 @@ router.get("/info/Credits", async (req, res) => {
res.render("staticPage/Credits");
});

router.use(mbkAuthRouter);

router.use("/", mainRoutes);

router.get('/simulate-error', (req, res, next) => {
Expand All @@ -124,7 +126,7 @@ router.use((err, req, res, next) => {
res.render('templates/Error/500', { error: err });
});

const port = 3030;
const port = 3130;

// Start the router
router.listen(port, () => {
Expand Down
Loading