From b511c89bdf29886f1226117334d3fe0a4031946e Mon Sep 17 00:00:00 2001 From: vsoch Date: Sun, 7 May 2023 17:37:01 -0600 Subject: [PATCH 1/2] test action the action is failing in other repos, and I want to test it here Signed-off-by: vsoch --- .github/workflows/test-action.yaml | 20 ++++++++++++++++++++ action.yml | 4 +--- scripts/generate-events.py | 7 +------ scripts/update-users.py | 1 - 4 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/test-action.yaml diff --git a/.github/workflows/test-action.yaml b/.github/workflows/test-action.yaml new file mode 100644 index 0000000..57e1a89 --- /dev/null +++ b/.github/workflows/test-action.yaml @@ -0,0 +1,20 @@ +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' + query: 'location%3AStanford' + 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() From 92e11670c50fa046943af7ee55b9a352afee1d16 Mon Sep 17 00:00:00 2001 From: vsoch Date: Sun, 7 May 2023 17:38:23 -0600 Subject: [PATCH 2/2] typo Signed-off-by: vsoch --- .github/workflows/test-action.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-action.yaml b/.github/workflows/test-action.yaml index 57e1a89..79106a7 100644 --- a/.github/workflows/test-action.yaml +++ b/.github/workflows/test-action.yaml @@ -14,7 +14,6 @@ jobs: uses: actions/checkout@v3 - name: Generate OpenSource Heartbeat Interface uses: ./ - with: - collection: 'docs/_events' - query: 'location%3AStanford' - token: ${{ secrets.GITHUB_TOKEN }} + with: + collection: 'docs/_events' + token: ${{ secrets.GITHUB_TOKEN }}