Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamTownsley committed Dec 20, 2024
2 parents c098094 + 65dc22a commit dfef4af
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "CodeQL Advanced"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '15 23 * * 0'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
security-events: write
packages: read
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: python
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
4 changes: 3 additions & 1 deletion app/api/routes/user.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from aws import db
from flask import Blueprint, abort, jsonify, request
import logging

bp_user = Blueprint("user", __name__, url_prefix="/user")

Expand All @@ -11,7 +12,8 @@ def create_user():
response = db.register_user(data["name"])
return jsonify({"message": "User created.", "user_id": response}), 201
except Exception as e:
return jsonify({"error": str(e)}), 400
logging.error("Error creating user: %s", str(e))
return jsonify({"error": "An internal error has occurred."}), 400


@bp_user.route("/", methods=["GET"])
Expand Down

0 comments on commit dfef4af

Please sign in to comment.