Skip to content

Commit

Permalink
Add token back to upload script
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushuk committed Apr 29, 2024
1 parent 25ecef5 commit 7bf1ad0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,8 @@ jobs:
run: ls

- name: Move template to pros-docs
env:
GH_PAT: ${{ secrets.MY_TOKEN || github.token }}
run: |
git config --global credential.helper "store --file ~/pros-docs/.git-credentials"
echo "https://${GH_PAT}@github.com" > ~/pros-docs/.git-credentials
python3 pros-branchline/upload.py ${{ github.event.inputs.name }} ${{ github.event.inputs.version }} ${{ github.event.inputs.new_template }}
run: python3 pros-branchline/upload.py ${{ github.event.inputs.name }} ${{ github.event.inputs.version }} ${{ github.event.inputs.new_template }} ${{ secrets.MY_TOKEN }}

- name: Look for zip
run: tree pros-docs/v5/_static/branchline

7 changes: 4 additions & 3 deletions upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
BASE_PATH = 'pros-docs/v5/_static/branchline'
DOCS_REPO_URL = 'https://github.com/purduesigbots/pros-docs.git'

def upload(name: str, version: str, new_template: int):
def upload(name: str, version: str, new_template: int, token: str):
"""
Uploads a template and updated registry files to docs.
Expand All @@ -33,7 +33,7 @@ def upload(name: str, version: str, new_template: int):
# TODO: make a PR or push to main?
subprocess.run('git -C pros-docs add .', shell=True)
subprocess.run(f'git -C pros-docs commit -m \"[BRANCHLINE] Update {name}\"', shell=True)
subprocess.run(f'git -C pros-docs', shell=True)
subprocess.run(f'git -C pros-docs https://{token}@github.com/purduesigbots/pros-docs', shell=True)


def main():
Expand All @@ -46,8 +46,9 @@ def main():
name = sys.argv[1]
version = sys.argv[2]
new_template = sys.argv[3]
token = sys.argv[4]

upload(name, version, int(new_template))
upload(name, version, int(new_template), token)

if __name__ == "__main__":
main()
Expand Down

0 comments on commit 7bf1ad0

Please sign in to comment.