Skip to content

Commit 767155d

Browse files
authored
major: remove backing web app (#107)
1 parent b548fde commit 767155d

File tree

12 files changed

+2451
-2671
lines changed

12 files changed

+2451
-2671
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ jobs:
1515
automerge:
1616
needs: build
1717
runs-on: ubuntu-latest
18+
permissions:
19+
pull-requests: write
20+
contents: write
1821
steps:
1922
- uses: fastify/github-action-merge-dependabot@main
2023
with:

README.md

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
This action automatically approves and merges dependabot PRs.
44

5-
## Usage
6-
7-
- **install the [GitHub App](https://github.com/apps/dependabot-merge-action) on the repositories or organization where you want to use this action.** Using a GitHub App is necessary since [this change](https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/) GitHub introduced which limits the permissions of the provided GITHUB_TOKEN and the availability of secrets in Dependabot pull requests. The source [code of the GitHub App](https://github.com/fastify/dependabot-merge-action-app/) is open source and hosted on Google Cloud Platform. You can also host your own version of the app and customize the `api-url` input to point to your hosted instance.
8-
- configure this action in your workflows providing the inputs described below
95

106
## Inputs
117

@@ -29,10 +25,6 @@ _Optional_ The merge method you would like to use (squash, merge, rebase). Defau
2925

3026
_Optional_ An arbitrary message that you'd like to comment on the PR after it gets auto-merged. This is only useful when you're recieving too much of noise in email and would like to filter mails for PRs that got automatically merged.
3127

32-
### `api-url`
33-
34-
_Optional_ A custom url where the external API which is delegated the task of approving and merging responds.
35-
3628
### `target`
3729

3830
_Optional_ A flag to only auto-merge updates based on Semantic Versioning. Defaults to `any`.
@@ -50,7 +42,21 @@ An example of a non-semantic version is a commit hash when using git submodules.
5042

5143
_Optional_ A pull request number, only required if triggered from a workflow_dispatch event. Typically this would be triggered by a script running in a seperate CI provider. See [Trigger action from workflow_dispatch event](#trigger-action-from-workflow_dispatch-event)
5244

53-
## Example usage
45+
## Usage
46+
47+
Configure this action in your workflows providing the inputs described above.
48+
Note that this action requires a GitHub token with additional permissions. You must use the [`permissions`](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#permissions) tag to specify the required rules or configure your [GitHub account](https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/).
49+
50+
The permissions required are:
51+
52+
- [`pull-requests`](https://docs.github.com/en/rest/reference/permissions-required-for-github-apps#permission-on-pull-requests) permission: it is needed to approve PRs.
53+
- [`contents`](https://docs.github.com/en/rest/reference/permissions-required-for-github-apps#permission-on-contents) permission: it is necessary to merge the pull request. You don't need it if you set `approve-only: true`, see the example below.
54+
55+
If some of the required permissions are missing, the action will fail with the error message:
56+
57+
```
58+
Error: Resource not accessible by integration
59+
```
5460

5561
### Basic example
5662

@@ -67,17 +73,26 @@ jobs:
6773
automerge:
6874
needs: build
6975
runs-on: ubuntu-latest
76+
77+
permissions:
78+
pull-requests: write
79+
contents: write
80+
7081
steps:
71-
- uses: fastify/github-action-merge-dependabot@v2.1.1
82+
- uses: fastify/github-action-merge-dependabot@v3.0.0
7283
with:
7384
github-token: ${{ secrets.GITHUB_TOKEN }}
7485
```
7586
7687
### Excluding packages
7788
7889
```yml
90+
permissions:
91+
pull-requests: write
92+
contents: write
93+
7994
steps:
80-
- uses: fastify/github-action-merge-dependabot@v2.1.1
95+
- uses: fastify/github-action-merge-dependabot@v3.0.0
8196
with:
8297
github-token: ${{ secrets.GITHUB_TOKEN }}
8398
exclude: 'react,fastify'
@@ -86,16 +101,18 @@ steps:
86101
### Approving without merging
87102
88103
```yml
104+
permissions:
105+
pull-requests: write
89106
steps:
90-
- uses: fastify/github-action-merge-dependabot@v2.1.1
107+
- uses: fastify/github-action-merge-dependabot@v3.0.0
91108
with:
92109
github-token: ${{ secrets.GITHUB_TOKEN }}
93110
approve-only: true
94111
```
95112
96113
### Trigger action from workflow_dispatch event
97114
98-
If you need to trigger this action manually, you can use the [workflow_dispatch](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event. A use case might be that your CI runs on a seperate provider, so you would like to run this action as a result of a successful CI run.
115+
If you need to trigger this action manually, you can use the [`workflow_dispatch`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event. A use case might be that your CI runs on a seperate provider, so you would like to run this action as a result of a successful CI run.
99116

100117
When using the `workflow_dispatch` approach, you will need to send the PR number as part of the input for this action:
101118

@@ -111,8 +128,11 @@ on:
111128
jobs:
112129
automerge:
113130
runs-on: ubuntu-latest
131+
permissions:
132+
pull-requests: write
133+
contents: write
114134
steps:
115-
- uses: fastify/github-action-merge-dependabot@v2.2.0
135+
- uses: fastify/github-action-merge-dependabot@v3.0.0
116136
with:
117137
github-token: ${{ secrets.GITHUB_TOKEN }}
118138
pr-number: ${{ github.event.inputs.pr-number }}

action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ inputs:
1919
description: "An arbitrary message that you'd like to comment on the PR after it gets auto-merged"
2020
required: false
2121
default: ''
22-
api-url:
23-
description: 'Url of the API where the application is running'
24-
required: false
25-
default: 'https://fastify-dependabot-merge-app-5uewp47fja-uc.a.run.app/'
2622
target:
2723
description: 'Auto-merge on major, minor, patch updates based on Semantic Versioning'
2824
required: false

0 commit comments

Comments
 (0)