-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Configure DNS #85
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,15 +33,10 @@ jobs: | |
- name: Main | ||
run: python main.py | ||
env: | ||
BOT_PASSWORD: ${{ secrets.BOT_PASSWORD }} | ||
GITHUB_EVENT_NAME: ${{ github.event_name }} | ||
GITHUB_REF: ${{ github.ref }} | ||
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} | ||
- uses: actions4git/setup-git@v1 | ||
- run: | | ||
git checkout --orphan artifact/${{ github.ref }} | ||
git add AllUp.wikitext | ||
git commit -m "Update data" | ||
git push --force origin artifact/${{ github.ref }} | ||
- name: Preview on Pull Request | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: thollander/[email protected] | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -29,7 +29,12 @@ def pull(title : str,split_line = False): | |||||
except: | ||||||
print(f'You do not have permission to get password.\nREF: {environ["GITHUB_REF"]}\nREPO_OWNER: {environ["GITHUB_REPOSITORY_OWNER"]}') | ||||||
|
||||||
def push(title : str,content_id : str,content : str): | ||||||
open(f'{title}.wikitext', 'w').write(content) | ||||||
if PR_TEST(): | ||||||
print(f'### {content_id}\n\n```go\n{content}\n```\n\n',file = open('PR_preview.md','a')) | ||||||
def push(content : str): | ||||||
if MAIN_REPO_BRANCH() or PR_TEST(): | ||||||
try: | ||||||
wiki = Wiki('sat.huijiwiki.com', '雨伞CKY', environ['BOT_PASSWORD']) | ||||||
yusancky marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
wiki.edit('模板:AllUp',content,'Edit via AllUp-Satwiki') | ||||||
except: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (code-quality): Use
Suggested change
|
||||||
open(f'{title}.wikitext', 'w').write(content) | ||||||
Comment on lines
+32
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||
elif PR_TEST(): | ||||||
print(f'```go\n{content}\n```\n\n',file = open('PR_preview.md','a')) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## Preview | ||
|
||
After _current_ modification of the PR, the program builds the main and TSS content as shown below. The content won't be uploaded to Satwiki before the PR is merged. | ||
After _current_ modification of the PR, the program builds the content as shown below. The content won't be uploaded to Satwiki before the PR is merged. | ||
|
There was a problem hiding this comment.
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.