|
3 | 3 | tags:
|
4 | 4 | - "v[0-9]+.[0-9]+.[0-9]+"
|
5 | 5 | jobs:
|
6 |
| - build: |
| 6 | + release: |
7 | 7 | runs-on: ubuntu-latest
|
8 | 8 | steps:
|
9 | 9 | - uses: actions/checkout@v3
|
|
19 | 19 | tag: ${{ github.ref_name }}
|
20 | 20 | run: |
|
21 | 21 | gh release create "$tag" --generate-notes
|
| 22 | +
|
| 23 | + pullrequest: |
| 24 | + needs: [release] |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v3 |
| 28 | + with: |
| 29 | + token: ${{ secrets.EXT_GITHUB }} |
| 30 | + repository: lnbits/lnbits-extensions |
| 31 | + path: './lnbits-extensions' |
| 32 | + |
| 33 | + - name: setup git user |
| 34 | + run: | |
| 35 | + git config --global user.name "alan" |
| 36 | + git config --global user.email "alan@lnbits.com" |
| 37 | +
|
| 38 | + - name: Create pull request in extensions repo |
| 39 | + env: |
| 40 | + GH_TOKEN: ${{ secrets.EXT_GITHUB }} |
| 41 | + repo_name: "${{ github.event.repository.name }}" |
| 42 | + tag: "${{ github.ref_name }}" |
| 43 | + branch: "update-${{ github.event.repository.name }}" |
| 44 | + title: "[UPDATE] ${{ github.event.repository.name }} to ${{ github.ref_name }}" |
| 45 | + body: "https://github.com/lnbits/${{ github.event.repository.name }}/releases/${{ github.ref_name }}" |
| 46 | + archive: "https://github.com/lnbits/${{ github.event.repository.name }}/archive/refs/tags/${{ github.ref_name }}.zip" |
| 47 | + run: | |
| 48 | + cd lnbits-extensions |
| 49 | + git checkout -b $branch |
| 50 | +
|
| 51 | + # if there is another open PR |
| 52 | + git pull origin $branch || echo "branch does not exist" |
| 53 | +
|
| 54 | + sh util.sh update_extension $repo_name $tag |
| 55 | +
|
| 56 | + git add -A |
| 57 | + git commit -am "$title" |
| 58 | + git push origin $branch |
| 59 | +
|
| 60 | + # check if pr exists before creating it |
| 61 | + gh config set pager cat |
| 62 | + check=$(gh pr list -H $branch | wc -l) |
| 63 | + test $check -ne 0 || gh pr create --title "$title" --body "$body" --repo lnbits/lnbits-extensions |
0 commit comments