Skip to content

Commit 01693a8

Browse files
authored
add install github app warning (#40)
* add install github app warning * update README.md
1 parent b7479f0 commit 01693a8

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This action automatically approves and merges dependabot PRs.
44

55
## Usage
66

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.
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.
88
- configure this action in your workflows providing the inputs described below
99

1010
## Inputs

dist/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -6203,6 +6203,8 @@ const {
62036203
API_URL,
62046204
} = getInputs()
62056205

6206+
const GITHUB_APP_URL = 'https://github.com/apps/dependabot-merge-action'
6207+
62066208
async function run() {
62076209
try {
62086210
const { pull_request: pr } = github.context.payload
@@ -6245,6 +6247,10 @@ async function run() {
62456247

62466248
const responseText = await response.text()
62476249

6250+
if (response.status === 400) {
6251+
logWarning(`Please ensure that Github App is installed ${GITHUB_APP_URL}`)
6252+
}
6253+
62486254
if (!response.ok) {
62496255
throw new Error(
62506256
`Request failed with status code ${response.status}: ${responseText}`

src/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ const {
1616
API_URL,
1717
} = getInputs()
1818

19+
const GITHUB_APP_URL = 'https://github.com/apps/dependabot-merge-action'
20+
1921
async function run() {
2022
try {
2123
const { pull_request: pr } = github.context.payload
@@ -58,6 +60,10 @@ async function run() {
5860

5961
const responseText = await response.text()
6062

63+
if (response.status === 400) {
64+
logWarning(`Please ensure that Github App is installed ${GITHUB_APP_URL}`)
65+
}
66+
6167
if (!response.ok) {
6268
throw new Error(
6369
`Request failed with status code ${response.status}: ${responseText}`

0 commit comments

Comments
 (0)