Docs #90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Docs | |
"on": | |
push: | |
# Only targets main branch to avoid amplification effects of auto-fixing | |
# the exact same stuff in multiple non-rebased branches. | |
branches: | |
- main | |
jobs: | |
#docs: | |
# uses: kdeldycke/workflows/.github/workflows/docs.yaml@v3.3.4 | |
awesome-template-sync: | |
name: Sync awesome template | |
if: > | |
startsWith(github.event.repository.name, 'awesome-') | |
&& github.event.repository.name != 'awesome-template' | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
with: | |
# We need custom PAT with workflows permissions so we can update all the boilerplate .github files from | |
# awesome-template. | |
token: ${{ secrets.WORKFLOW_UPDATE_GITHUB_PAT || secrets.GITHUB_TOKEN }} | |
- name: Sync from template repo | |
id: template_sync | |
uses: AndreasAugustin/actions-template-sync@v1.8.0 | |
with: | |
# We need custom PAT with workflows permissions so we can update all the boilerplate .github files from | |
# awesome-template. | |
github_token: ${{ secrets.WORKFLOW_UPDATE_GITHUB_PAT || secrets.GITHUB_TOKEN }} | |
source_repo_path: kdeldycke/awesome-template | |
pr_title: "[sync] Updates from `awesome-template` repository" | |
pr_commit_msg: "[sync] Updates from `awesome-template` repository" | |
pr_branch_name_prefix: "sync-awesome-template" | |
pr_labels: "📚 documentation" | |
is_pr_cleanup: true | |
- name: Print PR branch ID | |
run: | | |
echo "PR branch ID: ${{ steps.template_sync.outputs.pr_branch }}" | |
- name: Checkout template sync PR | |
uses: actions/checkout@v4.1.1 | |
with: | |
ref: ${{ steps.template_sync.outputs.pr_branch }} | |
# We need custom PAT with workflows permissions so we can update all the boilerplate .github files from | |
# awesome-template. | |
token: ${{ secrets.WORKFLOW_UPDATE_GITHUB_PAT || secrets.GITHUB_TOKEN }} | |
- name: Update repo URLs | |
# Replace "/kdeldycke/awesome-template/" in URLs by "/kdeldycke/awesome-<repo_id>/". | |
run: > | |
find ./.github/ -type f -iregex '.*\.\(md\|yaml\)$' -print -exec sed -i | |
"s/\/kdeldycke\/awesome-template\//\/kdeldycke\/${{ github.event.repository.name }}\//g" "{}" \; | |
- run: > | |
git push |