Skip to content

Commit 1278102

Browse files
committed
Created sync-changes-to-gitlab.yml
1 parent 5902ffe commit 1278102

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Sync changes to GitLab
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build:
12+
if: (github.repository == 'awesome-scripts/awesome-userscripts')
13+
runs-on: ubuntu-latest
14+
env:
15+
TZ: PST8PDT
16+
17+
steps:
18+
19+
- name: Checkout awesome-scripts/awesome-userscripts
20+
uses: actions/checkout@v5
21+
with:
22+
repository: awesome-scripts/awesome-userscripts
23+
path: awesome-scripts/awesome-userscripts
24+
25+
- name: Escape backticks in commit msg
26+
env:
27+
COMMIT_MSG: ${{ github.event.head_commit.message }}
28+
run: |
29+
echo "ESCAPED_MSG<<EOF" >> $GITHUB_ENV
30+
echo "$COMMIT_MSG" | sed 's/`/\`/g' >> $GITHUB_ENV
31+
echo "EOF" >> $GITHUB_ENV
32+
33+
- name: Config committer
34+
run: |
35+
gpg --batch --import <(echo "${{ secrets.GPG_PRIVATE_KEY }}")
36+
git config --global commit.gpgsign true
37+
git config --global user.name "kudo-sync-bot"
38+
git config --global user.email "auto-sync@kudoai.com"
39+
git config --global user.signingkey "${{ secrets.GPG_PRIVATE_ID }}"
40+
41+
- name: Push changes to gitlab.com/awesome-scripts/awesome-userscripts
42+
run: |
43+
cd ${{ github.workspace }}/awesome-scripts/awesome-userscripts
44+
git push --force https://oauth2:${{ secrets.GITLAB_SYNC_PAT }}@gitlab.com/awesome-scripts/awesome-userscripts.git main

0 commit comments

Comments
 (0)