mirror of
https://github.com/An0nX/telemt-docker.git
synced 2026-05-17 00:46:03 +03:00
build: update release commit & set updates check every 2 hours
This commit is contained in:
44
.github/workflows/telemt-docker-build.yml
vendored
44
.github/workflows/telemt-docker-build.yml
vendored
@@ -10,7 +10,7 @@ on:
|
||||
|
||||
schedule:
|
||||
# проверяем каждые 6 часов, появился ли новый релиз
|
||||
- cron: "17 */6 * * *"
|
||||
- cron: "0 */2 * * *"
|
||||
|
||||
push:
|
||||
branches: ["master"]
|
||||
@@ -134,6 +134,35 @@ jobs:
|
||||
echo "short_sha=${short_sha}"
|
||||
} >> "${GITHUB_OUTPUT}"
|
||||
|
||||
- name: Fetch release details for mirroring
|
||||
id: release_data
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
release_json="$(
|
||||
curl -fsSL \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer ${{ github.token }}" \
|
||||
"https://api.github.com/repos/${UPSTREAM_OWNER}/${UPSTREAM_REPO}/releases/latest"
|
||||
)"
|
||||
|
||||
title="$(echo "${release_json}" | jq -r '.name')"
|
||||
body="$(echo "${release_json}" | jq -r '.body')"
|
||||
author_login="$(echo "${release_json}" | jq -r '.author.login')"
|
||||
author_id="$(echo "${release_json}" | jq -r '.author.id')"
|
||||
published_at="$(echo "${release_json}" | jq -r '.published_at')"
|
||||
|
||||
{
|
||||
echo "title=${title}"
|
||||
echo "body<<EOF"
|
||||
echo "${body}"
|
||||
echo "EOF"
|
||||
echo "author_login=${author_login}"
|
||||
echo "author_id=${author_id}"
|
||||
echo "published_at=${published_at}"
|
||||
} >> "${GITHUB_OUTPUT}"
|
||||
|
||||
- name: Build decision (log)
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -200,11 +229,18 @@ jobs:
|
||||
- name: Commit & push updated state.json
|
||||
if: steps.check.outputs.changed == 'true'
|
||||
shell: bash
|
||||
env:
|
||||
GIT_AUTHOR_NAME: ${{ steps.release_data.outputs.author_login }}
|
||||
GIT_AUTHOR_EMAIL: ${{ steps.release_data.outputs.author_id }}+${{ steps.release_data.outputs.author_login }}@users.noreply.github.com
|
||||
GIT_COMMITTER_NAME: ${{ steps.release_data.outputs.author_login }}
|
||||
GIT_COMMITTER_EMAIL: ${{ steps.release_data.outputs.author_id }}+${{ steps.release_data.outputs.author_login }}@users.noreply.github.com
|
||||
GIT_AUTHOR_DATE: ${{ steps.release_data.outputs.published_at }}
|
||||
GIT_COMMITTER_DATE: ${{ steps.release_data.outputs.published_at }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config user.name "${GIT_AUTHOR_NAME}"
|
||||
git config user.email "${GIT_AUTHOR_EMAIL}"
|
||||
|
||||
git add "${STATE_FILE}"
|
||||
|
||||
@@ -213,5 +249,5 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git commit -m "ci: update build state (release ${{ steps.check.outputs.release_tag }})"
|
||||
git commit -m "${{ steps.release_data.outputs.title }}" -m "${{ steps.release_data.outputs.body }}"
|
||||
git push
|
||||
|
||||
Reference in New Issue
Block a user