Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
download

GitHub Action

accum-board-stats

v1.3.1

accum-board-stats

download

accum-board-stats

GitHub composite action to request and accumulate a forum board post replies and views statistic

Installation

Copy and paste the following snippet into your .yml file.

              

- name: accum-board-stats

uses: andry81-devops/gh-action--accum-board-stats@v1.3.1

Learn more about this action in andry81-devops/gh-action--accum-board-stats

Choose a version

GitHub repo size in bytes lines of code by tokei.rs

GitHub views|any|total GitHub views|any|14d GitHub views|unique per day|total GitHub views|unique per day|14d

GitHub clones|any|total GitHub clones|any|14d GitHub clones|unique per day|total GitHub clones|unique per day|14d

GitHub commits since latest version latest release name GitHub all releases

donate


UserlogChangelogDependenciesKnown issuescopyright and license Copyright and License

GitHub composite action to request and accumulate a forum board post replies and views statistic.

Tutorial to use with: https://github.com/andry81-devops/accum-content

All tutorials: https://github.com/andry81/index#tutorials

gh-action--accum-board-stats@master

Features:

  • Repository to track and repository to store traffic statistic can be different, and you may directly point the statistic as commits list: https://github.com/{{REPO_OWNER}}/{{REPO}}--gh-stats/commits/master/traffic/board/phpbb

  • Workflow is used accum-stats.sh bash script to accumulate traffic statistic

  • The script accumulates statistic both into a single file and into a set of files grouped by year and allocated per day: traffic/board/phpbb/by_year/YYYY/YYYY-MM-DD.json

  • The script can skip warnings and errors (CONTINUE_ON_INVALID_INPUT=1, CONTINUE_ON_EMPTY_CHANGES=1, CONTINUE_ON_RESIDUAL_CHANGES=1)

  • The script can generate textual changelog file with notes about changes per commit (including changes absence in case of skipped errors; ENABLE_GENERATE_CHANGELOG_FILE=1)

  • The script can insert the time string in format HH:MMZ additionally after the date in each commit message (by default inserts only a date for shorter commit messages; ENABLE_COMMIT_MESSAGE_DATE_WITH_TIME=1)

  • The script can print curl response in case of an error (by default only the progress prints; ENABLE_PRINT_CURL_RESPONSE_ON_ERROR=1)

USAGE

Warning You must replace all placeholder into respective values:

  • {{REPO_OWNER}} -> repository owner
  • {{REPO}} -> your repository
  • {{TOPIC_KEYWORDS}} -> topic keywords
  • {{TOPIC_AUTHOR}} -> topic author

Examples:

.github/workflows/accum-phpbb-board-stats.yml:

name: phpbb board stats updating every 4 hours

on:
  schedule:
    - cron: "0 */4 * * *"
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  accum-phpbb-board-stats:
    runs-on: ubuntu-latest

    steps:
      - uses: {{REPO_OWNER}}/gh-action--accum-board-stats@master
        with:
          # CAUTION: Beware of double quotes strip in case of usage yaml `>-` operator or even a single-quotted string!
          topic_query_url:          https://phpbb.com/board/search.php?keywords=\"{{TOPIC_KEYWORDS}}\"&terms=all&author={{TOPIC_AUTHOR}}&fid%5B%5D=6&sc=0&sf=titleonly&sr=topics&sk=i&sd=d&st=0&ch=1&t=0&submit=Search
          replies_sed_regexp:       s/.*class=\"posts\"[^0-9]*([0-9.]+).*/\1/p
          views_sed_regexp:         s/.*class=\"views\"[^0-9]*([0-9.]+).*/\1/p

          curl_flags: >-
            -v
            -H 'Cache-Control: no-cache'

          deps_repo_owner:          {{REPO_OWNER}}
          deps_repo_branch:         master
          deps_repo_read_token:     ${{ github.token }}

          commit_msg_entity:        my-board-1

          output_repo_owner:        {{REPO_OWNER}}
          output_repo:              {{REPO}}--phpbb-stats
          output_repo_branch:       master
          output_repo_dir:          traffic/board/phpbb
          output_repo_write_token:  ${{ secrets.READ_STATS_TOKEN }}

          #env: >-
          #  CONTINUE_ON_INVALID_INPUT=1
          #  CONTINUE_ON_EMPTY_CHANGES=1
          #  CONTINUE_ON_RESIDUAL_CHANGES=1
          #  ENABLE_GENERATE_CHANGELOG_FILE=1
          #  ENABLE_COMMIT_MESSAGE_DATE_WITH_TIME=1
          #  ENABLE_PRINT_CURL_RESPONSE_ON_ERROR=1
          #  CHANGELOG_FILE=changelog.txt

Note You can use secrets.READ_STATS_TOKEN instead of secrets.WRITE_STATS_TOKEN as long as both repositories under the same repository owner.

Warning You must use different values for deps_repo_owner and output_repo_owner if respective repositories actually under different repository owners.

Note See REUSE section for details if you have multiple repositories and want to store all GitHub workflow scripts (.github/workflows/*.yml) in a single repository.

Known Issues

https://github.com/andry81-devops/accum-content#known-issues

Last known issues updates

https://github.com/andry81-devops/accum-content#last-known-issues-updates

Code and documentation copyright 2021 Andrey Dibrov. Code released under MIT License