Skip to content

Commit

Permalink
add github token to action
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Aug 14, 2023
1 parent 9e4a07e commit b195ce6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
- run: ls -lah ./web-ext-artifacts
- run: cp $PWD/web-ext-artifacts/*xpi ../ophirofox.xpi
- run: ../update-manifest.py | tee /tmp/update_manifest.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
Expand Down
8 changes: 6 additions & 2 deletions update-manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import json
import sys
import os
import urllib.request
from pathlib import Path

Expand All @@ -14,8 +15,11 @@ def get_extension_manifest():


def get_github_releases():
url = "https://api.github.com/repos/lovasoa/ophirofox/releases"
return json.load(urllib.request.urlopen(url))
token = os.environ.get("GITHUB_TOKEN")
return json.load(urllib.request.urlopen(urllib.request.Request(
url="https://api.github.com/repos/lovasoa/ophirofox/releases",
headers={"authorization": "Bearer " + token} if token else {},
)))


def version_details(release):
Expand Down

0 comments on commit b195ce6

Please sign in to comment.