Skip to content

automation

automation #13

---
name: Update Readme
on: workflow_dispatch
jobs:
update_readme:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set update date variable
run: |
UPDATE_DATE=$(date)
echo "UPDATE_DATE=${UPDATE_DATE}" >> $GITHUB_ENV
- name: Update last sync date to launchpad
env:
BEGIN_TAG: "<!-- BEGIN SYNC INFO -->"
END_TAG: "<!-- END SYNC INFO -->"
run: |
UPDATE=$(cat README.md | perl -0777 -pe 's#(${{ env.BEGIN_TAG }})(?:.|\n)*?(${{ env.END_TAG }})#${1}\nLast sync to launchpad: ${{ env.UPDATE_DATE }}\n${2}#g')
echo "${UPDATE}" > README.md
- uses: EndBug/add-and-commit@v9
with:
message: "docs(readme): Bump sync date"
default_author: github_actions
call-sync-repo:
uses: ./.github/workflows/sync-repo.yaml
secrets:
GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_PRIVATE_KEY }}
GIT_SSH_KNOWN_HOSTS: ${{ secrets.GIT_SSH_KNOWN_HOSTS }}