-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] add workflow for creating pull request inside ext repo
add a pull request into `lnbits/lnbits-extensions` repo with updated version
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.EXT_GITHUB }} | ||
repository: dni/.dotfiles | ||
path: './.dotfiles' | ||
|
||
- name: setup git user | ||
run: | | ||
git config --global user.name "alan" | ||
git config --global user.email "alan@lnbits.com" | ||
- name: Create pull request in extensions repo | ||
env: | ||
GH_TOKEN: ${{ secrets.EXT_GITHUB }} | ||
branch: "update-${{ github.event.repository.name }}" | ||
title: "[UPDATE] ${{ github.event.repository.name }} to ${{ github.ref_name }}" | ||
body: "https://github.com/lnbits/${{ github.event.repository.name }}/releases/${{ github.ref_name }}" | ||
run: | | ||
cd .dotfiles | ||
git checkout -b $branch | ||
# if there is another open PR | ||
git pull origin $branch || echo "branch does not exist" | ||
touch TEST01 | ||
git add -A | ||
git commit -am "$title" | ||
git push origin $branch | ||
# check if pr exists before creating it | ||
gh config set pager cat | ||
check=$(gh pr list -H $branch | wc -l) | ||
test $check -ne 0 || gh pr create --title "$title" --body "$body" --repo dni/.dotfiles |