Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

🔐 Sync Keys 🔐 #43

🔐 Sync Keys 🔐

🔐 Sync Keys 🔐 #43

Workflow file for this run

name: 🔐 Sync Keys 🔐
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: "0 */6 * * *" #every 6 hrs
jobs:
sync:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
statuses: read
strategy:
max-parallel: 1
fail-fast: false
matrix:
include:
- repo: "bincache"
key: "https://raw.githubusercontent.com/pkgforge/bincache/refs/heads/main/keys/minisign.pub"
- repo: "pkgcache"
key: "https://raw.githubusercontent.com/pkgforge/pkgcache/refs/heads/main/keys/minisign.pub"
- repo: "soarpkgs"
key: "https://raw.githubusercontent.com/pkgforge/soarpkgs/refs/heads/main/keys/minisign.pub"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: main
fetch-depth: "1"
filter: "blob:none"
- name: Setup Env
run: |
#presets
set +x ; set +e
#-------------#
#tmp
SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}"
echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}"
#GH Dirs
mkdir -pv "${GITHUB_WORKSPACE}/main/${{ matrix.repo }}/data"
echo "GH_PAGER=" >> "${GITHUB_ENV}"
echo "GIT_TERMINAL_PROMPT=0" >> "${GITHUB_ENV}"
echo "GIT_ASKPASS=/bin/echo" >> "${GITHUB_ENV}"
#-------------#
##User-Agent
USER_AGENT="$(curl -qfsSL 'https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Misc/User-Agents/ua_firefox_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}"
echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}"
continue-on-error: true
- name: Sync ${{ matrix.repo }} [${{ matrix.key }}]
run: |
#presets
set +x ; set +e
#-------------#
pushd "$(mktemp -d)" >/dev/null 2>&1
curl -qfsSL "${{ matrix.key }}" -o "./minisign.pub"
if [[ -s "./minisign.pub" && $(stat -c%s "./minisign.pub") -gt 10 ]]; then
cat "./minisign.pub" | tr -d '[:space:]' > "${GITHUB_WORKSPACE}/main/${{ matrix.repo }}/data/minisign.pub"
fi
popd >/dev/null 2>&1
continue-on-error: true
- name: Get DateTime & Purge files (=> 95 MB)
run: |
#Presets
set +x ; set +e
#--------------#
UTC_TIME="$(TZ='UTC' date +'%Y-%m-%d (%I:%M:%S %p)')"
echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}"
#Sync
cd "${GITHUB_WORKSPACE}/main"
git pull origin main --no-edit 2>/dev/null
#Purge
find "${GITHUB_WORKSPACE}/main" -path "${GITHUB_WORKSPACE}/main/.git" -prune -o -type f -size +95M -exec rm -rvf "{}" + 2>/dev/null
continue-on-error: true
- uses: stefanzweifel/git-auto-commit-action@v6
with:
repository: ./main
commit_message: "🔐 Synced Keys [${{ matrix.repo }})] 🔐"
#push_options: '--force'
continue-on-error: true
- name: Pull & Push (2)
run: |
#Presets
set +x ; set +e
#--------------#
cd "${GITHUB_WORKSPACE}/main"
git pull origin main --no-edit 2>/dev/null
git pull origin main --ff-only ; git merge --no-ff -m "Merge & Sync"
continue-on-error: true
- uses: stefanzweifel/git-auto-commit-action@v6
with:
repository: ./main
commit_message: "🔐 Synced Keys [${{ matrix.repo }})] 🔐"
#push_options: '--force'
continue-on-error: true