Skip to content

Latest commit

 

History

History
42 lines (36 loc) · 2.18 KB

File metadata and controls

42 lines (36 loc) · 2.18 KB

github-visitors-counter-action

An action to accumulate the number of visitors who have viewed the public repositories. It uses the Traffic API to fetch the number of visitors.

Use the action

The personal access token is required to get the action work and public_repo is the only required permission. When the token is generated, that needs to be put under the Actions secrets with a dedicated name (e.g. PAT_TOKEN_PUBLIC as the follow one).

The action will change the structure of the repository, so it is good to use a new repository to record views. Check the example if you wish.

If excluded-list is not used to exclude some repositories you don't want to count, all public repositories will be considered.

name: View Update Action
on:
  schedule:
    - cron: '0 */24 * * *'
  workflow_dispatch:

jobs:
  update:
    name: Update Count and Uniques
    runs-on: ubuntu-latest
    steps:
      - name: Get the resources
        uses: actions/checkout@v3
      - name: Call the github-visitors-counter-action
        uses: taurusni/github-visitors-counter-action@v1
        with:
          repo-token: ${{ secrets.PAT_TOKEN_PUBLIC  }}
          excluded-list: |
            <repo1>
            <repo2>

Reference