|
5 | 5 | schedule: |
6 | 6 | - cron: '0 15-23,0-3 * * 1-5' |
7 | 7 |
|
| 8 | +permissions: {} |
| 9 | + |
8 | 10 | jobs: |
9 | 11 | autoupdate: |
10 | 12 | strategy: |
|
13 | 15 | - main |
14 | 16 | - 3-x-y |
15 | 17 | runs-on: ubuntu-latest |
| 18 | + environment: auto-updater |
16 | 19 | steps: |
17 | | - - name: Generate GitHub App token |
| 20 | + - name: Generate GitHub App token (updater app) |
18 | 21 | uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1 |
19 | 22 | id: generate-token |
20 | 23 | with: |
|
42 | 45 | npm run update-abi-registry |
43 | 46 | git add abi_registry.json |
44 | 47 | - name: Commit Changes to ABI registry |
| 48 | + id: commit-changes |
45 | 49 | uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0 |
46 | 50 | with: |
47 | 51 | fail-on-no-changes: false |
48 | 52 | message: 'feat: update ABI registry' |
| 53 | + ref: "feat/update-abi-registry-${{ matrix.branch }}-${{ hashFiles('abi_registry.json') }}" |
49 | 54 | token: ${{ steps.generate-token.outputs.token }} |
| 55 | + - name: Create pull request |
| 56 | + if: ${{ steps.commit-changes.outputs.sha }} |
| 57 | + shell: bash |
| 58 | + env: |
| 59 | + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |
| 60 | + run: | |
| 61 | + gh pr create \ |
| 62 | + --title "feat: update ABI registry (${{ matrix.branch }})" \ |
| 63 | + --body "Automated PR to update abi_registry.json" \ |
| 64 | + --head "feat/update-abi-registry-${{ matrix.branch }}-${{ hashFiles('abi_registry.json') }}" \ |
| 65 | + --base ${{ matrix.branch }} |
| 66 | + - name: Generate GitHub App token (approver app) |
| 67 | + uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1 |
| 68 | + if: ${{ steps.commit-changes.outputs.sha }} |
| 69 | + id: generate-token-approver |
| 70 | + with: |
| 71 | + creds: ${{ secrets.APPROVER_GH_APP_CREDS }} |
| 72 | + - name: Approve and merge pull request |
| 73 | + if: ${{ steps.commit-changes.outputs.sha }} |
| 74 | + shell: bash |
| 75 | + env: |
| 76 | + GITHUB_TOKEN: ${{ steps.generate-token-approver.outputs.token }} |
| 77 | + run: | |
| 78 | + gh pr review "feat/update-abi-registry-${{ matrix.branch }}-${{ hashFiles('abi_registry.json') }}" --approve |
| 79 | + gh pr merge "feat/update-abi-registry-${{ matrix.branch }}-${{ hashFiles('abi_registry.json') }}" --auto --squash |
0 commit comments