Skip to content

Commit

Permalink
2023.07.02:
Browse files Browse the repository at this point in the history
* new: bash: use `ENABLE_REPO_STORE_COMMITS_URL_PRINT_TO_CHANGELOG`/`ENABLE_REPO_STATS_COMMITS_URL_PRINT_TO_CHANGELOG` and `GHWF_REPO_STORE_COMMITS_URL`/`GHWF_REPO_STATS_COMMITS_URL` variables to print `Content Store Repository`/`Statistic Output Repository` commit URL 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 df14957 commit 26ffcb2
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 126 deletions.
6 changes: 3 additions & 3 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-workflow/blob/master/userlog.md">Userlog</a>
• <a href="https://github.com/andry81-devops/gh-workflow/blob/master/changelog.txt">Changelog</a>
<a href="https://github.com/andry81-devops/gh-workflow/tree/HEAD/userlog.md">Userlog</a>
• <a href="https://github.com/andry81-devops/gh-workflow/tree/HEAD/changelog.txt">Changelog</a>
• <a href="#dependentees">Dependentees</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>
</p>
Expand All @@ -64,4 +64,4 @@ Tutorials to use with: https://github.com/andry81/index#tutorials</h4>

## <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-workflow/blob/master/license.txt)
Code and documentation copyright 2021 Andrey Dibrov. Code released under [MIT License](https://github.com/andry81-devops/gh-workflow/tree/HEAD/license.txt)
15 changes: 14 additions & 1 deletion bash/board/accum-stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ tkl_include_or_abort "$GH_WORKFLOW_ROOT/bash/github/init-tacklelib-workflow.sh"

current_date_time_utc="$(date --utc +%FT%TZ)"

current_date_utc="${current_date_time_utc/%T*}"

current_date_time_utc_sec="$(date --utc -d "${current_date_time_utc}" +%s)" # seconds from epoch to current date with time

# on exit handler
tkl_push_trap 'gh_flush_print_buffers; gh_prepend_changelog_file' EXIT

Expand All @@ -48,7 +52,16 @@ if (( ENABLE_GITHUB_ACTIONS_RUN_URL_PRINT_TO_CHANGELOG )) && [[ -n "$GHWF_GITHUB
"GitHub Actions Run: $GHWF_GITHUB_ACTIONS_RUN_URL # $GITHUB_RUN_NUMBER"
fi

current_date_utc="${current_date_time_utc/%T*}"
if (( ENABLE_REPO_STATS_COMMITS_URL_PRINT_TO_CHANGELOG )) && [[ -n "$GHWF_REPO_STATS_COMMITS_URL" ]]; then
(( repo_stats_commits_url_until_date_time_utc_sec = current_date_time_utc_sec + 60 * 5 )) # +5min approximation and truncation to days

repo_stats_commits_url_until_date_time_utc="$(date --utc -d "@$repo_stats_commits_url_until_date_time_utc_sec" +%FT%TZ)"

repo_stats_commits_url_until_date_utc_day="${repo_stats_commits_url_until_date_time_utc/%T*}"

gh_write_notice_to_changelog_text_bullet_ln \
"Stats Output Repository: $GHWF_REPO_STATS_COMMITS_URL&until=$repo_stats_commits_url_until_date_utc_day"
fi

# exit with non 0 code if nothing is changed
IFS=$'\n' read -r -d '' last_replies last_views <<< "$(jq -c -r ".replies,.views" $stats_json)"
Expand Down
17 changes: 15 additions & 2 deletions bash/cache/accum-content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ fi

current_date_time_utc="$(date --utc +%FT%TZ)"

current_date_utc="${current_date_time_utc/%T*}"

current_date_utc_sec="$(date --utc -d "${current_date_utc}Z" +%s)" # seconds from epoch to current date without time

current_date_time_utc_sec="$(date --utc -d "${current_date_time_utc}" +%s)" # seconds from epoch to current date with time

# on exit handler
tkl_push_trap 'gh_flush_print_buffers; gh_prepend_changelog_file' EXIT

Expand All @@ -75,9 +81,16 @@ if (( ENABLE_GITHUB_ACTIONS_RUN_URL_PRINT_TO_CHANGELOG )) && [[ -n "$GHWF_GITHUB
"GitHub Actions Run: $GHWF_GITHUB_ACTIONS_RUN_URL # $GITHUB_RUN_NUMBER"
fi

current_date_utc="${current_date_time_utc/%T*}"
if (( ENABLE_REPO_STORE_COMMITS_URL_PRINT_TO_CHANGELOG )) && [[ -n "$GHWF_REPO_STORE_COMMITS_URL" ]]; then
(( repo_store_commits_url_until_date_time_utc_sec = current_date_time_utc_sec + 60 * 5 )) # +5min approximation and truncation to days

current_date_utc_sec="$(date --utc -d "${current_date_utc}Z" +%s)" # seconds from epoch to current date
repo_store_commits_url_until_date_time_utc="$(date --utc -d "@$repo_store_commits_url_until_date_time_utc_sec" +%FT%TZ)"

repo_store_commits_url_until_date_utc_day="${repo_store_commits_url_until_date_time_utc/%T*}"

gh_write_notice_to_changelog_text_bullet_ln \
"Content Store Repository: $GHWF_REPO_STORE_COMMITS_URL&until=$repo_store_commits_url_until_date_utc_day"
fi

IFS=$'\n' read -r -d '' config_dirs_num config_entries_init_shell config_entries_init_run <<< \
$("${YQ_CMDLINE_READ[@]}" \
Expand Down
15 changes: 14 additions & 1 deletion bash/github/accum-rate-limits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ tkl_include_or_abort "$GH_WORKFLOW_ROOT/bash/github/init-tacklelib-workflow.sh"

current_date_time_utc="$(date --utc +%FT%TZ)"

current_date_utc="${current_date_time_utc/%T*}"

current_date_time_utc_sec="$(date --utc -d "${current_date_time_utc}" +%s)" # seconds from epoch to current date with time

# on exit handler
tkl_push_trap 'gh_flush_print_buffers; gh_prepend_changelog_file' EXIT

Expand All @@ -42,7 +46,16 @@ if (( ENABLE_GITHUB_ACTIONS_RUN_URL_PRINT_TO_CHANGELOG )) && [[ -n "$GHWF_GITHUB
"GitHub Actions Run: $GHWF_GITHUB_ACTIONS_RUN_URL # $GITHUB_RUN_NUMBER"
fi

current_date_utc="${current_date_time_utc/%T*}"
if (( ENABLE_REPO_STATS_COMMITS_URL_PRINT_TO_CHANGELOG )) && [[ -n "$GHWF_REPO_STATS_COMMITS_URL" ]]; then
(( repo_stats_commits_url_until_date_time_utc_sec = current_date_time_utc_sec + 60 * 5 )) # +5min approximation and truncation to days

repo_stats_commits_url_until_date_time_utc="$(date --utc -d "@$repo_stats_commits_url_until_date_time_utc_sec" +%FT%TZ)"

repo_stats_commits_url_until_date_utc_day="${repo_stats_commits_url_until_date_time_utc/%T*}"

gh_write_notice_to_changelog_text_bullet_ln \
"Stats Output Repository: $GHWF_REPO_STATS_COMMITS_URL&until=$repo_stats_commits_url_until_date_utc_day"
fi

# stats between previous/next script execution (dependent to the pipeline scheduler times)

Expand Down
15 changes: 14 additions & 1 deletion bash/github/accum-stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ stat_list_key="$stat_entity"

current_date_time_utc="$(date --utc +%FT%TZ)"

current_date_utc="${current_date_time_utc/%T*}"

current_date_time_utc_sec="$(date --utc -d "${current_date_time_utc}" +%s)" # seconds from epoch to current date with time

# on exit handler
tkl_push_trap 'gh_flush_print_buffers; gh_prepend_changelog_file' EXIT

Expand All @@ -44,7 +48,16 @@ if (( ENABLE_GITHUB_ACTIONS_RUN_URL_PRINT_TO_CHANGELOG )) && [[ -n "$GHWF_GITHUB
"GitHub Actions Run: $GHWF_GITHUB_ACTIONS_RUN_URL # $GITHUB_RUN_NUMBER"
fi

current_date_utc="${current_date_time_utc/%T*}"
if (( ENABLE_REPO_STATS_COMMITS_URL_PRINT_TO_CHANGELOG )) && [[ -n "$GHWF_REPO_STATS_COMMITS_URL" ]]; then
(( repo_stats_commits_url_until_date_time_utc_sec = current_date_time_utc_sec + 60 * 5 )) # +5min approximation and truncation to days

repo_stats_commits_url_until_date_time_utc="$(date --utc -d "@$repo_stats_commits_url_until_date_time_utc_sec" +%FT%TZ)"

repo_stats_commits_url_until_date_utc_day="${repo_stats_commits_url_until_date_time_utc/%T*}"

gh_write_notice_to_changelog_text_bullet_ln \
"Stats Output Repository: $GHWF_REPO_STATS_COMMITS_URL&until=$repo_stats_commits_url_until_date_utc_day"
fi

# CAUTION:
# Sometimes the json data file comes empty for some reason.
Expand Down
15 changes: 14 additions & 1 deletion bash/inpage/accum-downloads.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ tkl_include_or_abort "$GH_WORKFLOW_ROOT/bash/github/init-tacklelib-workflow.sh"

current_date_time_utc="$(date --utc +%FT%TZ)"

current_date_utc="${current_date_time_utc/%T*}"

current_date_time_utc_sec="$(date --utc -d "${current_date_time_utc}" +%s)" # seconds from epoch to current date with time

# on exit handler
tkl_push_trap 'gh_flush_print_buffers; gh_prepend_changelog_file' EXIT

Expand All @@ -43,7 +47,16 @@ if (( ENABLE_GITHUB_ACTIONS_RUN_URL_PRINT_TO_CHANGELOG )) && [[ -n "$GHWF_GITHUB
"GitHub Actions Run: $GHWF_GITHUB_ACTIONS_RUN_URL # $GITHUB_RUN_NUMBER"
fi

current_date_utc="${current_date_time_utc/%T*}"
if (( ENABLE_REPO_STATS_COMMITS_URL_PRINT_TO_CHANGELOG )) && [[ -n "$GHWF_REPO_STATS_COMMITS_URL" ]]; then
(( repo_stats_commits_url_until_date_time_utc_sec = current_date_time_utc_sec + 60 * 5 )) # +5min approximation and truncation to days

repo_stats_commits_url_until_date_time_utc="$(date --utc -d "@$repo_stats_commits_url_until_date_time_utc_sec" +%FT%TZ)"

repo_stats_commits_url_until_date_utc_day="${repo_stats_commits_url_until_date_time_utc/%T*}"

gh_write_notice_to_changelog_text_bullet_ln \
"Stats Output Repository: $GHWF_REPO_STATS_COMMITS_URL&until=$repo_stats_commits_url_until_date_utc_day"
fi

# exit with non 0 code if nothing is changed
IFS=$'\n' read -r -d '' last_downloads <<< "$(jq -c -r ".downloads" $stats_json)"
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: bash: use `ENABLE_REPO_STORE_COMMITS_URL_PRINT_TO_CHANGELOG`/`ENABLE_REPO_STATS_COMMITS_URL_PRINT_TO_CHANGELOG` and `GHWF_REPO_STORE_COMMITS_URL`/`GHWF_REPO_STATS_COMMITS_URL` variables to print `Content Store Repository`/`Statistic Output Repository` commit URL 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
Loading

0 comments on commit 26ffcb2

Please sign in to comment.