Skip to content

Commit

Permalink
2023.07.02:
Browse files Browse the repository at this point in the history
* new: action.yml: added `ENABLE_REPO_STATS_COMMITS_URL_PRINT_TO_CHANGELOG` variable to be able to print Statistic Output Repository commit URL (approximated by +5min date) into being committed changelog file
* refactor: README.md: replaced `blob/master` to `tree/HEAD` in all links as not dependent on specific branch name
  • Loading branch information
andry81 committed Jul 2, 2023
1 parent 4395315 commit 95b5088
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 41 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
---

<p align="center">
<a href="https://github.com/andry81-devops/gh-action--accum-inpage-downloads/blob/master/userlog.md">Userlog</a>
• <a href="https://github.com/andry81-devops/gh-action--accum-inpage-downloads/blob/master/changelog.txt">Changelog</a>
<a href="https://github.com/andry81-devops/gh-action--accum-inpage-downloads/tree/HEAD/userlog.md">Userlog</a>
• <a href="https://github.com/andry81-devops/gh-action--accum-inpage-downloads/tree/HEAD/changelog.txt">Changelog</a>
• <a href="#dependecies">Dependencies</a>
• <a href="#known-issues">Known issues</a>
• <a href="#copyright-and-license"><img src="https://github.com/andry81-cache/gh-content-static-cache/raw/master/common/badges/license/mit-license.svg" valign="middle" alt="copyright and license" />&nbsp;Copyright and License</a>
Expand All @@ -65,7 +65,7 @@ All tutorials: https://github.com/andry81/index#tutorials
* 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-downloads.sh](https://github.com/andry81-devops/gh-workflow/blob/master/bash/inpage/accum-downloads.sh) bash script to accumulate traffic downloads
* Workflow is used [accum-downloads.sh](https://github.com/andry81-devops/gh-workflow/tree/HEAD/bash/inpage/accum-downloads.sh) bash script to accumulate traffic downloads

* The script accumulates statistic both into a single file and into a set of files grouped by year and allocated per day:
`traffic/downloads/mypage/by_year/YYYY/YYYY-MM-DD.json`
Expand All @@ -83,6 +83,11 @@ All tutorials: https://github.com/andry81/index#tutorials

* Can print GitHub Actions Run URL (with workflow run number) into the changelog file to reference the log on the GitHub from the changelog file (`ENABLE_GITHUB_ACTIONS_RUN_URL_PRINT_TO_CHANGELOG=1`)

* Can print Statistic Output Repository commit URL into the changelog file to reference the commit from being committed changelog file (`ENABLE_REPO_STATS_COMMITS_URL_PRINT_TO_CHANGELOG=1`)

> **Note** The actual hash of the commit can not be know on the moment of the commit. So instead of the commit hash, an approximate date of the commit is used (~ +5 min ahead) in format of:
> `https://github.com/{{REPO_OWNER}}/{{REPO}}--gh-stats/commits?branch={{BRANCH}}&until=YYYY-MM-DD`
* Can print curl response in case of an error (by default only the progress prints; `ENABLE_PRINT_CURL_RESPONSE_ON_ERROR=1`)

# USAGE
Expand Down Expand Up @@ -142,6 +147,7 @@ jobs:
ENABLE_COMMIT_MESSAGE_DATE_WITH_TIME=1 # insert the time string in format HH:MMZ additionally after the date in each commit message
ENABLE_COMMIT_MESSAGE_WITH_WORKFLOW_RUN_NUMBER=1 # insert the workflow run number after date/time prefix in each commit message
ENABLE_GITHUB_ACTIONS_RUN_URL_PRINT_TO_CHANGELOG=1
ENABLE_REPO_STATS_COMMITS_URL_PRINT_TO_CHANGELOG=1
# CONTINUE_ON_INVALID_INPUT=1
# CONTINUE_ON_EMPTY_CHANGES=1
# CHANGELOG_FILE=changelog.txt
Expand All @@ -167,4 +173,4 @@ https://github.com/andry81-devops/accum-content#last-known-issues-updates

## <a name="copyright-and-license">Copyright and License</a>

Code and documentation copyright 2021 Andrey Dibrov. Code released under [MIT License](https://github.com/andry81-devops/gh-action--accum-inpage-downloads/blob/master/license.txt)
Code and documentation copyright 2021 Andrey Dibrov. Code released under [MIT License](https://github.com/andry81-devops/gh-action--accum-inpage-downloads/tree/HEAD/license.txt)
6 changes: 4 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ inputs:
# ENABLE_COMMIT_MESSAGE_DATE_WITH_TIME=1 # insert the time string in format HH:MMZ additionally after the date in each commit message
# ENABLE_COMMIT_MESSAGE_WITH_WORKFLOW_RUN_NUMBER=1 # insert the workflow run number after date/time prefix in each commit message
# ENABLE_GITHUB_ACTIONS_RUN_URL_PRINT_TO_CHANGELOG=1
# ENABLE_REPO_STATS_COMMITS_URL_PRINT_TO_CHANGELOG=1
# CONTINUE_ON_INVALID_INPUT=1
# CONTINUE_ON_EMPTY_CHANGES=1

Expand Down Expand Up @@ -163,7 +164,8 @@ runs:
INPUT_ENV="${INPUT_ENV//[$'\n\r']/}" # remove all line returns
$GH_WORKFLOW_ROOT/bash/github/set-env-from-args.sh \
${INPUT_ENV} \
"GHWF_GITHUB_ACTIONS_RUN_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
"GHWF_GITHUB_ACTIONS_RUN_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
"GHWF_REPO_STATS_COMMITS_URL=https://github.com/${{ github.repository }}/commits?branch=${{ inputs.output_repo_branch }}"
- name: variables validation
shell: bash
Expand Down Expand Up @@ -242,7 +244,7 @@ runs:
directory: inpage-downloads
github_token: ${{ inputs.output_repo_write_token }}

- name: print commit parameters
- name: print commit parameters into pipeline log only
shell: bash
run: |
$GH_WORKFLOW_ROOT/bash/github/print-notice.sh \
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023.07.02:
* new: action.yml: added `ENABLE_REPO_STATS_COMMITS_URL_PRINT_TO_CHANGELOG` variable to be able to print Statistic Output Repository commit URL (approximated by +5min date) into being committed changelog file
* refactor: README.md: replaced `blob/master` to `tree/HEAD` in all links as not dependent on specific branch name

2023.04.20:
* fixed: README.md: static badges address change

Expand Down
75 changes: 40 additions & 35 deletions userlog.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,90 @@
> :information_source: this log lists user most visible changes
> :warning: to find all changes use [changelog.txt](https://github.com/andry81-devops/gh-action--accum-inpage-downloads/blob/master/changelog.txt) file in a directory
> :warning: to find all changes use [changelog.txt](https://github.com/andry81-devops/gh-action--accum-inpage-downloads/tree/HEAD/changelog.txt) file in a directory
> :information_source: Legend: :shield: - security; :wrench: - fixed; :new: - new; :pencil: - changed; :twisted_rightwards_arrows: - refactor
## 2023.07.02:
* :new: new: action.yml: added `ENABLE_REPO_STATS_COMMITS_URL_PRINT_TO_CHANGELOG` variable to be able to print Statistic Output Repository commit URL (approximated by +5min date) into being committed changelog file

## 2022.12.18:
* changed: action.yml: removed `ENABLE_COMMIT_REFERENCE_URL_PRINT_TO_CHANGELOG` variable because is not possible to make a commit and in the same time save the commit hash in a being committed file
* :pencil: changed: action.yml: removed `ENABLE_COMMIT_REFERENCE_URL_PRINT_TO_CHANGELOG` variable because is not possible to make a commit and in the same time save the commit hash in a being committed file

## 2022.12.11:
* new: action.yml: added `ENABLE_COMMIT_REFERENCE_URL_PRINT_TO_CHANGELOG` variable to be able to print Commit Reference URL into the changelog file
* :new: new: action.yml: added `ENABLE_COMMIT_REFERENCE_URL_PRINT_TO_CHANGELOG` variable to be able to print Commit Reference URL into the changelog file

## 2022.10.12:
* new: action.yml: added `flags` parameter with builtin parse into `GH_WORKFLOW_FLAGS` environment variable as a single line string
* new: action.yml: added ability to insert workflow run number into commit message after date/time prefix (`ENABLE_COMMIT_MESSAGE_WITH_WORKFLOW_RUN_NUMBER=1`)
* changed: action.yml: use `$GH_WORKFLOW_ROOT/_common/update-permissions.sh` script to automate permissions update
* :new: new: action.yml: added `flags` parameter with builtin parse into `GH_WORKFLOW_FLAGS` environment variable as a single line string
* :new: new: action.yml: added ability to insert workflow run number into commit message after date/time prefix (`ENABLE_COMMIT_MESSAGE_WITH_WORKFLOW_RUN_NUMBER=1`)
* :pencil: changed: action.yml: use `$GH_WORKFLOW_ROOT/_common/update-permissions.sh` script to automate permissions update

## 2022.09.08:
* fixed: action.yml: multiline input in `${{ input.env }}`
* :wrench: fixed: action.yml: multiline input in `${{ input.env }}`

## 2022.08.26:
* new: action.yml: added `ENABLE_GITHUB_ACTIONS_RUN_URL_PRINT_TO_CHANGELOG` and `GHWF_GITHUB_ACTIONS_RUN_URL` variables to be able to print GitHub Actions run URL into the changelog file
* :new: new: action.yml: added `ENABLE_GITHUB_ACTIONS_RUN_URL_PRINT_TO_CHANGELOG` and `GHWF_GITHUB_ACTIONS_RUN_URL` variables to be able to print GitHub Actions run URL into the changelog file

## 2022.08.12:
* new: action.yml: flush print annotations at the last always executed step
* :new: new: action.yml: flush print annotations at the last always executed step

## 2022.08.09:
* new: action.yml: print commit reference url to the log
* :new: new: action.yml: print commit reference url to the log

## 2022.05.11:
* new: action.yml: added `commit_msg_entity` optional input parameter as replacement of `stat_entity` in the commit message
* changed: action.yml: renamed `stat_entity_path` to `stat_entity` to select implementation
* changed: action.yml: swapped `COMMIT_MESSAGE_PREFIX` and `COMMIT_MESSAGE_SUFFIX` in all scripts to further improve readability in case of GitHub commit message truncation
* :new: new: action.yml: added `commit_msg_entity` optional input parameter as replacement of `stat_entity` in the commit message
* :pencil: changed: action.yml: renamed `stat_entity_path` to `stat_entity` to select implementation
* :pencil: changed: action.yml: swapped `COMMIT_MESSAGE_PREFIX` and `COMMIT_MESSAGE_SUFFIX` in all scripts to further improve readability in case of GitHub commit message truncation

## 2022.05.06:
* fixed: action.yml: `CHANGELOG_FILE` must be always not empty
* :wrench: fixed: action.yml: `CHANGELOG_FILE` must be always not empty

## 2022.05.04:
* new: action.yml: added `COMMIT_MESSAGE_PREFIX` to split an automated user commit message into prefix and suffix parts
* :new: new: action.yml: added `COMMIT_MESSAGE_PREFIX` to split an automated user commit message into prefix and suffix parts

## 2022.04.16:
* fixed: action.yml: `mkdir` in a working copy moved after git checkout instead of before to avoid accidental remove on cleanup
* changed: action.yml: added `mkdir-p` parameter usage
* :wrench: fixed: action.yml: `mkdir` in a working copy moved after git checkout instead of before to avoid accidental remove on cleanup
* :pencil: changed: action.yml: added `mkdir-p` parameter usage

## 2022.04.15:
* changed: action.yml: switched to use `andry81-devops/gh-action--git-checkout` action instead of `actions/checkout`
* :pencil: changed: action.yml: switched to use `andry81-devops/gh-action--git-checkout` action instead of `actions/checkout`

## 2022.04.02:
* changed: action.yml: switch to use `actions/checkout@v3` action
* :pencil: changed: action.yml: switch to use `actions/checkout@v3` action

## 2022.03.31:
* changed: action.yml: `COMMIT_MESSAGE_DATE_TIME_PREFIX` variable usage
* :pencil: changed: action.yml: `COMMIT_MESSAGE_DATE_TIME_PREFIX` variable usage

## 2022.03.23:
* new: action.yml: `env` input parameter to explicitly declare global environment variables
* new: action.yml: `changelog_dir` variable usage is added
* :new: new: action.yml: `env` input parameter to explicitly declare global environment variables
* :new: new: action.yml: `changelog_dir` variable usage is added

## 2022.01.13:
* new: action.yml: workflow script execution time in the Automated Update commit message
* :new: new: action.yml: workflow script execution time in the Automated Update commit message

## 2022.01.01:
* new: action.yml: added `deps_repo_branch` parameter to use specific repository branch as dependency
* new: action.yml: added `deps_repo_read_token` parameter to use specific read token for repository as dependency
* :new: new: action.yml: added `deps_repo_branch` parameter to use specific repository branch as dependency
* :new: new: action.yml: added `deps_repo_read_token` parameter to use specific read token for repository as dependency

## 2022.01.01:
* new: action.yml: use `GH_WORKFLOW_ROOT` variable to include `gh-workflow` shell scripts as dependencies
* changed: action.yml: head annotations workaround through `gh-workflow` script
* changed: action.yml: removed relative paths usage
* :new: new: action.yml: use `GH_WORKFLOW_ROOT` variable to include `gh-workflow` shell scripts as dependencies
* :pencil: changed: action.yml: head annotations workaround through `gh-workflow` script
* :pencil: changed: action.yml: removed relative paths usage

## 2021.12.30:
* new: action.yml: print output repository directory url into pipeline
* :new: new: action.yml: print output repository directory url into pipeline

## 2021.12.30:
* changed: action.yml: removed print statistics change into pipeline as bugged in the current GitHub implementation (breaks notification prints from a script)
* changed: action.yml: moved `COMMIT_MESSAGE_SUFFIX` variable creation into workflow scripts
* :pencil: changed: action.yml: removed print statistics change into pipeline as bugged in the current GitHub implementation (breaks notification prints from a script)
* :pencil: changed: action.yml: moved `COMMIT_MESSAGE_SUFFIX` variable creation into workflow scripts

## 2021.12.30:
* new: action.yml: additionally print statistics change into pipeline
* :new: new: action.yml: additionally print statistics change into pipeline

## 2021.12.18:
* new: `README.md` readme file
* :new: new: `README.md` readme file

## 2021.12.18:
* changed: action.yml: commit message suffix with changes in statistic
* :pencil: changed: action.yml: commit message suffix with changes in statistic

## 2021.12.05:
* changed: action.yml: removed usage of the `write_error_to_file` and `write_warning_to_file` environment variables as not required anymore
* :pencil: changed: action.yml: removed usage of the `write_error_to_file` and `write_warning_to_file` environment variables as not required anymore

0 comments on commit 95b5088

Please sign in to comment.