Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure DNS #85

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Configure DNS #85

wants to merge 3 commits into from

Conversation

yusancky
Copy link
Owner

@yusancky yusancky commented Apr 3, 2024

No description provided.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @yusancky - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Potential undefined variable 'title' in the exception handling block. (link)
  • Hard-coded username detected. (link)
  • Proper use of secrets for BOT_PASSWORD. (link)
Here's what I looked at during the review
  • 🔴 General issues: 1 blocking issue
  • 🔴 Security: 2 blocking issues
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Docstrings: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment on lines +32 to +38
def push(content : str):
if MAIN_REPO_BRANCH() or PR_TEST():
try:
wiki = Wiki('sat.huijiwiki.com', '雨伞CKY', environ['BOT_PASSWORD'])
wiki.edit('模板:AllUp',content,'Edit via AllUp-Satwiki')
except:
open(f'{title}.wikitext', 'w').write(content)
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): Potential undefined variable 'title' in the exception handling block.

The variable 'title' is used in the exception handling block but it's not defined within the scope of the new push function. Consider passing 'title' as an argument to the function or handling the exception differently.

AllUp_utils/wiki.py Show resolved Hide resolved
- name: Main
run: python main.py
env:
BOT_PASSWORD: ${{ secrets.BOT_PASSWORD }}
Copy link
Contributor

Choose a reason for hiding this comment

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

🚨 issue (security): Proper use of secrets for BOT_PASSWORD.

Good practice to use GitHub secrets for sensitive information. Ensure the secret is managed securely.

try:
wiki = Wiki('sat.huijiwiki.com', '雨伞CKY', environ['BOT_PASSWORD'])
wiki.edit('模板:AllUp',content,'Edit via AllUp-Satwiki')
except:
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (code-quality): Use except Exception: rather than bare except: (do-not-use-bare-except)

Suggested change
except:
except Exception:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant