diff --git a/.github/workflows/test-action.yaml b/.github/workflows/test-action.yaml new file mode 100644 index 0000000..79106a7 --- /dev/null +++ b/.github/workflows/test-action.yaml @@ -0,0 +1,19 @@ +name: Test Open Source Heartbeat Action +on: + pull_request: [] + push: + branches: + - main + +jobs: + install-spack: + runs-on: ubuntu-latest + name: Install Spack + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Generate OpenSource Heartbeat Interface + uses: ./ + with: + collection: 'docs/_events' + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/action.yml b/action.yml index c83ec56..06eedf8 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,3 @@ -# action.yml name: 'Open Source Heartbeat Interface' description: 'Create an interface for open source events on GitHub.' branding: @@ -32,8 +31,7 @@ inputs: description: 'The collections folder under docs to write events to. Defaults to _events.' default: _events token: - description: > - Auth token used to fetch the repository. + description: Auth token used to fetch the repository. default: ${{ github.token }} runs: using: 'docker' diff --git a/scripts/generate-events.py b/scripts/generate-events.py index 0838dc3..9c1acb3 100755 --- a/scripts/generate-events.py +++ b/scripts/generate-events.py @@ -2,7 +2,7 @@ """ -Copyright (C) 2020-2022 Vanessa Sochat. +Copyright (C) 2020-2023 Vanessa Sochat. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed @@ -78,7 +78,6 @@ def get_users(users_file): def get_org_events(orgs): - # We will lookup public events api_base = "https://api.github.com/orgs/{orgname}/events" @@ -100,7 +99,6 @@ def get_org_events(orgs): def get_user_events(users): - # We will lookup public events api_base = "https://api.github.com/users/{username}/events/public" # https://api.github.com/orgs/poldracklab/events @@ -123,7 +121,6 @@ def get_user_events(users): def generate_content(event, user, seen): - # Get shared metadata repo_name = event["repo"]["name"] repo = "https://github.com/%s" % repo_name @@ -275,7 +272,6 @@ def write_events(events, output_dir): files = set() for user, eventlist in events.items(): for event in eventlist: - # We don't care about watching, forking, etc. # https://docs.github.com/en/developers/webhooks-and-events/github-event-types if event["type"] in [ @@ -323,7 +319,6 @@ def write_events(events, output_dir): def main(): - parser = get_parser() args, extra = parser.parse_known_args() diff --git a/scripts/update-users.py b/scripts/update-users.py index 8ff0480..dd06f75 100755 --- a/scripts/update-users.py +++ b/scripts/update-users.py @@ -118,7 +118,6 @@ def write_file(content, filename): def main(): - parser = get_parser() args, extra = parser.parse_known_args()