Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass the default github token to the github-token input #264

Merged
merged 3 commits into from Sep 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-linked-issues.yml
Expand Up @@ -12,5 +12,5 @@ jobs:
- uses: nearform/github-action-check-linked-issues@v1
id: check-linked-issues
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ github.token }}
exclude-branches: "release/**, dependabot/**"
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
@@ -1,5 +1,5 @@
name: CI
on:
on:
push:
branches: main
pull_request:
Expand All @@ -25,5 +25,5 @@ jobs:
steps:
- uses: fastify/github-action-merge-dependabot@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ github.token }}
target: minor
2 changes: 1 addition & 1 deletion .github/workflows/notify-release.yml
Expand Up @@ -10,4 +10,4 @@ jobs:
- name: Notify release
uses: nearform/github-action-notify-release@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ github.token }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Expand Up @@ -25,7 +25,7 @@ jobs:
node-version: 16
- uses: nearform/optic-release-automation-action@v3
with:
github-token: ${{ secrets.github_token }}
github-token: ${{ github.token }}
semver: ${{ github.event.inputs.semver }}
sync-semver-tags: true
build-command: |
Expand Down
11 changes: 2 additions & 9 deletions README.md
Expand Up @@ -7,7 +7,7 @@ This action automatically approves and merges dependabot PRs.

### `github-token`

**Required** A GitHub token. See below for additional information.
_Optional_ A GitHub token. See below for additional information.

### `exclude`

Expand Down Expand Up @@ -80,8 +80,6 @@ jobs:

steps:
- uses: fastify/github-action-merge-dependabot@v3.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```

### Excluding packages
Expand All @@ -94,7 +92,6 @@ permissions:
steps:
- uses: fastify/github-action-merge-dependabot@v3.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
exclude: 'react,fastify'
```

Expand All @@ -106,7 +103,6 @@ permissions:
steps:
- uses: fastify/github-action-merge-dependabot@v3.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
approve-only: true
```

Expand Down Expand Up @@ -134,7 +130,6 @@ jobs:
steps:
- uses: fastify/github-action-merge-dependabot@v3.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.inputs.pr-number }}
```

Expand Down Expand Up @@ -178,13 +173,11 @@ jobs:
steps:
- - uses: fastify/github-action-merge-dependabot@v2.1.1
+ - uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```

## Notes

- A GitHub token is automatically provided by Github Actions, which can be accessed using `secrets.GITHUB_TOKEN` and supplied to the action as an input `github-token`.
- A GitHub token is automatically provided by Github Actions, which can be accessed using `github.token` and supplied to the action as an input `github-token`.
- Only the [GitHub native Dependabot integration](https://docs.github.com/en/github/administering-a-repository/keeping-your-dependencies-updated-automatically) is supported, the old [Dependabot Preview app](https://github.com/marketplace/dependabot-preview) isn't.
- Make sure to use `needs: <jobs>` to delay the auto-merging until CI checks (test/build) are passed.
- If you want to use GitHub's [auto-merge](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/automatically-merging-a-pull-request) feature but still use this action to approve Pull Requests without merging, use `approve-only: true`.
Expand Down
3 changes: 2 additions & 1 deletion action.yml
Expand Up @@ -3,7 +3,8 @@ description: 'Automatically approve and merge dependabot PRs'
inputs:
github-token:
description: 'A GitHub token'
required: true
required: false
default: ${{ github.token }}
exclude:
description: 'Packages that you want to manually review before upgrading'
required: false
Expand Down