diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bc67374..a0b1f29 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,20 +1,24 @@ +--- version: 2 updates: - - package-ecosystem: 'npm' + - package-ecosystem: npm directory: '/' schedule: - interval: 'daily' - target-branch: 'main' - versioning-strategy: 'auto' + interval: daily + commit-message: + prefix: feat + include: scope allow: - - dependency-name: '@seamapi/*' - dependency-type: 'development' + - dependency-type: development ignore: - - dependency-name: '@seamapi/*' - update-types: ['version-update:semver-major'] + - dependency-name: '*' + update-types: + - 'version-update:semver-major' groups: seam: dependency-type: development + patterns: + - '@seamapi/*' update-types: - patch - minor diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 118d6ef..01ad8d8 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -7,12 +7,45 @@ on: - main jobs: - merge: - name: Merge #${{ number }} + changes: + name: Get changes runs-on: ubuntu-latest timeout-minutes: 30 if: github.actor == 'dependabot[bot]' + permissions: + checks: read + outputs: + has_changes: ${{ steps.changed.outputs.any_changed == 'true' }} + is_generation_successful: ${{ steps.checks.outputs.conclusion == 'success' }} + steps: + - name: Wait for checks + uses: fountainhead/action-wait-for-check@v1.2.0 + id: checks + with: + checkName: Generate code + ref: ${{ github.event.pull_request.head.sha }} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Get changed generated files + id: changed + uses: tj-actions/changed-files@v44 + with: + files: | + seam/** + merge: + name: Merge + runs-on: ubuntu-latest + timeout-minutes: 30 + needs: changes + if: needs.changes.outputs.has_changes == 'true' steps: + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v44 + with: + files_separator: ' ' + dir_names: true + dir_names_include_files: | + src/lib/seam/connect/routes/** - name: Approve pull request run: gh pr review --approve "$PR_URL" env: @@ -23,3 +56,15 @@ jobs: env: PR_URL: ${{ github.event.pull_request.html_url }} GH_TOKEN: ${{ secrets.GH_TOKEN }} + close: + name: Close + runs-on: ubuntu-latest + timeout-minutes: 30 + needs: changes + if: needs.changes.outputs.has_changes == 'false' && needs.changes.outputs.is_generation_successful == 'true' + steps: + - name: Close pull request + run: gh pr close "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GH_TOKEN }}