You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR_URL: {% raw %}${{github.event.pull_request.html_url}}{% endraw %}
117
115
```
118
116
119
-
{% endraw %}
120
-
121
117
## Automatically approving a pull request
122
118
123
119
You can automatically approve {% data variables.product.prodname_dependabot %} pull requests by using the {% data variables.product.prodname_cli %} in a workflow.
124
120
125
121
Example:
126
122
127
-
{% raw %}
123
+
128
124
129
125
```yaml copy
130
126
{% data reusables.actions.actions-not-certified-by-github-comment %}
github-token: "{% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}"
147
143
- name: Approve a PR
148
144
run: gh pr review --approve "$PR_URL"
149
145
env:
150
-
PR_URL: ${{github.event.pull_request.html_url}}
151
-
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
146
+
PR_URL: {% raw %}${{github.event.pull_request.html_url}}{% endraw %}
147
+
GH_TOKEN: {% raw %}${{secrets.GITHUB_TOKEN}}{% endraw %}
152
148
```
153
149
154
-
{% endraw %}
155
-
156
150
## Enabling automerge on a pull request
157
151
158
152
If you want to allow maintainers to mark certain pull requests for automerge, you can use {% data variables.product.prodname_dotcom %}'s automerge functionality. This enables the pull request to be merged when any tests and approvals required by the branch protection rules are successfully met.
@@ -161,7 +155,6 @@ For more information, see [AUTOTITLE](/pull-requests/collaborating-with-pull-req
161
155
162
156
You can instead use {% data variables.product.prodname_actions %} and the {% data variables.product.prodname_cli %}. Here is an example that automerges all patch updates to `my-dependency`:
163
157
164
-
{% raw %}
165
158
166
159
```yaml copy
167
160
{% data reusables.actions.actions-not-certified-by-github-comment %}
PR_URL: {% raw %}${{github.event.pull_request.html_url}}{% endraw %}
183
+
GH_TOKEN: {% raw %}${{secrets.GITHUB_TOKEN}}{% endraw %}
191
184
```
192
185
193
-
{% endraw %}
194
-
195
186
> [!NOTE]
196
187
> If you use status checks to test pull requests, you should enable **Require status checks to pass before merging** for the target branch for {% data variables.product.prodname_dependabot %} pull requests. This branch protection rule ensures that pull requests are not merged unless **all the required status checks pass**. For more information, see [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule).
0 commit comments