Skip to content

Sync issue templates from Aurora source #4

Sync issue templates from Aurora source

Sync issue templates from Aurora source #4

name: Sync issue templates from Aurora source
on:
workflow_dispatch:
schedule:
- cron: "15 5 * * *"
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
id: app
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.AURORA_APP_ID }}
private_key: ${{ secrets.AURORA_APP_PRIVATE_KEY }}
- name: Checkout target repo (this repo)
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
token: ${{ steps.app.outputs.token }}
- name: Checkout source templates (gccloudone-aurora/.github)
uses: actions/checkout@v4
with:
repository: gccloudone-aurora/.github
ref: main
path: _source
token: ${{ steps.app.outputs.token }}
- name: Sync ISSUE_TEMPLATE directory
run: |
if [ -d "_source/ISSUE_TEMPLATE" ]; then
echo "Syncing ISSUE_TEMPLATE directory..."
mkdir -p .github/ISSUE_TEMPLATE
rsync -a --delete \
_source/.github/ISSUE_TEMPLATE/ \
.github/ISSUE_TEMPLATE/
else
echo "Directory _source/ISSUE_TEMPLATE does not exist. Skipping sync step."
fi
- name: Commit changes if any
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: sync issue templates from gccloudone-aurora/.github"
commit_user_name: "aurora-svc"
commit_user_email: "aurora-svc@users.noreply.github.com"
skip_dirty_check: false
file_pattern: ".github/ISSUE_TEMPLATE/*"