Skip to content

Commit

Permalink
fixup! fixup! fixup! auto-update template in separate repo
Browse files Browse the repository at this point in the history
  • Loading branch information
MingweiSamuel committed Dec 23, 2024
1 parent 5ab5849 commit 20a4124
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,21 +160,31 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout main repo
uses: actions/checkout@v2
with:
token: ${{ steps.generate_token.outputs.token }}

- name: Push to dfir repo
shell: bash
run: |
git -C "$DIR" init -b main -q
git -C "$DIR" init -q
git -C "$DIR" remote add origin "git@github.com:$GITHUB_REPOSITORY_OWNER/dfir-template.git"
# git -C "$DIR" config credential.helper "$(git config credential.helper)"
# git -C "$DIR" config 'http.https://github.com/.extraheader' "$(git config 'http.https://github.com/.extraheader')"
git -C "$DIR" config credential.helper "$(git config credential.helper)"
git -C "$DIR" config 'http.https://github.com/.extraheader' "$(git config 'http.https://github.com/.extraheader')"
git -C "$DIR" config core.autocrlf input
git -C "$DIR" config core.safecrlf false
git -C "$DIR" config user.name "hydro-project-bot[bot]"
git -C "$DIR" config user.email "132423234+hydro-project-bot[bot]@users.noreply.github.com"
git -C "$DIR" add -A
git -C "$DIR" -c 'user.name=github-actions[bot]' -c 'user.email=41898282+github-actions[bot]@users.noreply.github.com' \
commit -m "Update template $(date -I) $(git rev-parse HEAD)"
git -C "$DIR" push -f -u origin main --quiet
git -C "$DIR" commit -m "Update template $(date -I) $(git rev-parse HEAD)"
git -C "$DIR" push -f -u origin HEAD:main --quiet
env:
DIR: template/dfir

0 comments on commit 20a4124

Please sign in to comment.