5 Commits

Author SHA1 Message Date
Gitea Actions
fdc5b46ef3 Update manifest version to 7.1.7 [▶️] 2025-12-22 01:49:29 +00:00
7aa47b74b9 Merge branch 'main' of https://git.icc.gg/ivancarlos/bundledcmdb
All checks were successful
Build, Push, Publish / Build & Release (push) Successful in 23m1s
2025-12-21 22:49:10 -03:00
fa056218d8 fix readme updater not working 2025-12-21 22:49:03 -03:00
Gitea Actions
c4cb329139 Update manifest version to 7.1.6 [▶️] 2025-12-22 01:02:18 +00:00
e30591b584 make update_readme action
All checks were successful
Build, Push, Publish / Build & Release (push) Successful in 23m12s
2025-12-21 21:57:10 -03:00
2 changed files with 17 additions and 35 deletions

View File

@@ -1,20 +1,22 @@
name: Update README name: Update README
# Allow GitHub Actions to commit and push changes # Allow Gitea Actions to commit and push changes
permissions: permissions:
contents: write contents: write
on: on:
workflow_dispatch: workflow_dispatch:
schedule: schedule:
- cron: '0 4 * * *' # Every day at 4 AM UTC - cron: "0 4 * * *" # Every day at 4 AM UTC
jobs: jobs:
update-readme: update-readme:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
env: env:
SOURCE_REPO: ivancarlosti/.github SOURCE_REPO: ivancarlos/.gitea
SOURCE_BRANCH: main SOURCE_BRANCH: main
steps: steps:
@@ -26,53 +28,33 @@ jobs:
with: with:
repository: ${{ env.SOURCE_REPO }} repository: ${{ env.SOURCE_REPO }}
ref: ${{ env.SOURCE_BRANCH }} ref: ${{ env.SOURCE_BRANCH }}
token: ${{ secrets.CR_PAT }}
path: source_readme path: source_readme
- name: Update README.md (buttons and footer) - name: Update README.md (footer only)
run: | run: |
set -e set -e
REPO_NAME="${GITHUB_REPOSITORY##*/}"
# --- Extract buttons block from source ---
BUTTONS=$(awk '/<!-- buttons -->/{flag=1;next}/<!-- endbuttons -->/{flag=0}flag' source_readme/README.md)
BUTTONS_UPDATED=$(echo "$BUTTONS" | sed "s/\.github/${REPO_NAME}/g")
# --- Extract footer block from source (everything from <!-- footer --> onward) --- # --- Extract footer block from source (everything from <!-- footer --> onward) ---
FOOTER=$(awk '/<!-- footer -->/{flag=1}flag' source_readme/README.md) FOOTER=$(awk '/<!-- footer -->/{flag=1}flag' source_readme/README.md)
# --- Replace buttons section in README.md ---
UPDATED=$(awk -v buttons="$BUTTONS_UPDATED" '
BEGIN { skip=0 }
/<!-- buttons -->/ {
print
print buttons
skip=1
next
}
/<!-- endbuttons -->/ && skip {
print
skip=0
next
}
!skip { print }
' README.md)
# --- Replace everything after <!-- footer --> with FOOTER --- # --- Replace everything after <!-- footer --> with FOOTER ---
echo "$UPDATED" | awk -v footer="$FOOTER" ' awk -v footer="$FOOTER" '
/<!-- footer -->/ { /<!-- footer -->/ {
print footer print footer
found=1 found=1
exit exit
} }
{ print } { print }
' > README.tmp && mv README.tmp README.md ' README.md > README.tmp && mv README.tmp README.md
- name: Remove source_readme from git index - name: Remove source_readme from git index
run: git rm --cached -r source_readme || true run: rm -rf source_readme
- name: Commit and push changes - name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v5 run: |
with: git config user.name "Gitea Actions"
file_pattern: README.md git config user.email "actions@git.icc.gg"
commit_message: "Sync README from template [▶️]" git add README.md
branch: ${{ github.ref_name }} git commit -m "Sync README from template [▶️]" || echo "Nothing to commit"
git push origin ${{ github.ref_name }}

View File

@@ -1,4 +1,4 @@
{ {
"version": "7.1.5", "version": "7.1.7",
"author": "Ivan Carlos" "author": "Ivan Carlos"
} }