Skip to content

Commit

Permalink
fix(actions/create-and-merge-pull-request): remove approve
Browse files Browse the repository at this point in the history
  • Loading branch information
neilime committed Mar 28, 2023
1 parent c5df5b1 commit ef57c0c
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 65 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/generate-dependabot-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/generate-dependabot-config.yml@0.3.4
with:
# GitHub App ID to generate GitHub token in place of private-access-token.
# GitHub App ID to generate GitHub token in place of github-token.
# See https://github.com/tibdex/github-app-token
github-app-id: ""

Expand All @@ -33,31 +33,25 @@ jobs:
# See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request)
github-token: ""

# GitHub private access token for approving & merging pull request.
# Must be different from github-token.
# See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request)
private-access-token: ""

# GitHub App private key to generate GitHub token in place of private-access-token.
# GitHub App private key to generate GitHub token in place of github-token.
# See https://github.com/tibdex/github-app-token
github-app-key: ""
```
<!-- end usage -->
<!-- start secrets -->
| **Secret** | **Description** | **Default** | **Required** |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ------------ |
| **<code>github-token</code>** | GitHub token for creating and merging pull request (permissions contents: write and pull-requests: write). See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request) | <code>GITHUB_TOKEN</code> | **false** |
| **<code>private-access-token</code>** | GitHub private access token for approving & merging pull request. Must be different from github-token. See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request) | <code></code> | **false** |
| **<code>github-app-key</code>** | GitHub App private key to generate GitHub token in place of <code>private-access-token</code>. See [https://github.com/tibdex/github-app-token](https://github.com/tibdex/github-app-token) | <code></code> | **false** |
| **Secret** | **Description** | **Default** | **Required** |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ------------ |
| **<code>github-token</code>** | GitHub token for creating and merging pull request (permissions contents: write and pull-requests: write). See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request) | <code>GITHUB_TOKEN</code> | **false** |
| **<code>github-app-key</code>** | GitHub App private key to generate GitHub token in place of <code>github-token</code>. See [https://github.com/tibdex/github-app-token](https://github.com/tibdex/github-app-token) | <code></code> | **false** |
<!-- end secrets -->
<!-- start inputs -->
| **Inputs** | **Description** | **Default** | **Required** |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------ |
| **<code>github-app-id</code>** | GitHub App ID to generate GitHub token in place of <code>private-access-token</code>. See [https://github.com/tibdex/github-app-token](https://github.com/tibdex/github-app-token) | <code></code> | **false** |
| **Inputs** | **Description** | **Default** | **Required** |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------ |
| **<code>github-app-id</code>** | GitHub App ID to generate GitHub token in place of <code>github-token</code>. See [https://github.com/tibdex/github-app-token](https://github.com/tibdex/github-app-token) | <code></code> | **false** |
<!-- end inputs -->
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/generate-dependabot-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ on:
workflow_call:
inputs:
github-app-id:
description: "GitHub App ID to generate GitHub token in place of private-access-token. See https://github.com/tibdex/github-app-token"
description: "GitHub App ID to generate GitHub token in place of github-token. See https://github.com/tibdex/github-app-token"
required: false
type: string
secrets:
github-token:
description: "GitHub token for creating and merging pull request (permissions contents: write and pull-requests: write). See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request)"
private-access-token:
description: "GitHub private access token for approving & merging pull request. Must be different from github-token. See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request)"
github-app-key:
description: "GitHub App private key to generate GitHub token in place of private-access-token. See https://github.com/tibdex/github-app-token"
description: "GitHub App private key to generate GitHub token in place of github-token. See https://github.com/tibdex/github-app-token"

jobs:
generate-dependabot-config:
Expand All @@ -40,8 +38,7 @@ jobs:

- uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@main
with:
github-token: ${{ secrets.github-token || github.token }}
private-access-token: ${{ steps.generate-token.outputs.token || secrets.private-access-token }}
github-token: ${{ steps.generate-token.outputs.token || secrets.github-token || github.token }}
branch: chore/dependabot-config
title: "chore: update dependabot config"
body: Update dependabot config for glob directories
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/release-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,22 @@ jobs:
github-app-id: ""

secrets:
# GitHub token for creating and merging pull request (permissions contents: write and pull-requests: write).
# GitHub token for creating and merging pull request (permissions contents: write and pull-requests: write, workflows: write).
# See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request)
github-token: ""

# GitHub private access token for approving & merging pull request.
# Must be different from github-token.
# See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request)
private-access-token: ""

# GitHub App private key to generate GitHub token in place of private-access-token.
# GitHub App private key to generate GitHub token in place of github-token.
# See https://github.com/tibdex/github-app-token
github-app-key: ""
```
<!-- end usage -->
<!-- start secrets -->
| **Secret** | **Description** | **Default** | **Required** |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------- | ------------ |
| **<code>github-token</code>** | GitHub token for creating pull request. See [https://github.com/hoverkraft-tech/ci-github-common/tree/main/actions/create-and-merge-pull-request](https://github.com/hoverkraft-tech/ci-github-common/tree/main/actions/create-and-merge-pull-request) | <code>GITHUB_TOKEN</code> | **false** |
| **<code>private-access-token</code>** | GitHub private access token for approving & merging pull request. Must be different from github-token. See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request) | <code></code> | **false** |
| **<code>github-app-key</code>** | GitHub App private key to generate GitHub token in place of private-access-token. See [https://github.com/tibdex/github-app-token](https://github.com/tibdex/github-app-token) | <code></code> | **false** |
| **Secret** | **Description** | **Default** | **Required** |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ------------ |
| **<code>github-token</code>** | GitHub token for creating and merging pull request (permissions contents: write and pull-requests: write, workflows: write). See [../../actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request) | <code>GITHUB_TOKEN</code> | **false** |
| **<code>github-app-key</code>** | GitHub App private key to generate GitHub token in place of github-token. See [https://github.com/tibdex/github-app-token](https://github.com/tibdex/github-app-token) | <code></code> | **false** |
<!-- end secrets -->
<!-- start inputs -->
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/release-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ on:
type: string
secrets:
github-token:
description: "GitHub token for creating and merging pull request (permissions contents: write and pull-requests: write). See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request)"
private-access-token:
description: "GitHub private access token for approving & merging pull request. Must be different from github-token. See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request)"
description: "GitHub token for creating and merging pull request (permissions contents: write and pull-requests: write, workflows: write). See [actions/create-and-merge-pull-request](../../actions/create-and-merge-pull-request)"
github-app-key:
description: "GitHub App private key to generate GitHub token in place of private-access-token. See https://github.com/tibdex/github-app-token"
description: "GitHub App private key to generate GitHub token in place of github-token. See https://github.com/tibdex/github-app-token"

jobs:
prepare-release:
Expand Down Expand Up @@ -195,8 +193,7 @@ jobs:

- uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@main
with:
github-token: ${{ secrets.github-token || github.token }}
private-access-token: ${{ steps.generate-token.outputs.token || secrets.private-access-token }}
github-token: ${{ steps.generate-token.outputs.token || secrets.github-token || github.token }}
branch: docs/actions-workflows-documentation-update
title: "docs: update actions and workflows documentation"
body: Update actions and workflows documentation
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Opinionated GitHub actions and workflows for common continuous integration needs

### - [Create or update comment](actions/create-or-update-comment/README.md)

### - [Get github actions bot user](actions/get-github-actions-bot-user/README.md)
### - [Get GitHub actions bot user](actions/get-github-actions-bot-user/README.md)

### - [Get issue number](actions/get-issue-number/README.md)

Expand Down
20 changes: 10 additions & 10 deletions actions/create-and-merge-pull-request/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- end title -->
<!-- start description -->

Action to create and merge Pull Request. Opinionated, set Github Actions bot as author, approve merge request before merging if private access token is provided then rebase and merge.
Action to create and merge Pull Request. Opinionated, set GitHub Actions bot as author, approve merge request before merging if private access token is provided then rebase and merge.

<!-- end description -->

Expand All @@ -21,7 +21,7 @@ Allow GitHub Actions to create and approve pull requests](https://docs.github.co
with:
# GitHub token for creating and merging pull request (permissions contents: write
# and pull-requests: write). See https://github.com/peter-evans/create-pull-request#action-inputs
# Default: ${{ github.token }}
# Default: GITHUB_TOKEN
github-token: ""

# GitHub private access token for approving & merging pull request. Must be
Expand All @@ -44,14 +44,14 @@ Allow GitHub Actions to create and approve pull requests](https://docs.github.co
<!-- end usage -->
<!-- start inputs -->
| **Input** | **Description** | **Default** | **Required** |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------ |
| **<code>github-token</code>** | GitHub token for creating and merging pull request (permissions contents: write and pull-requests: write). See https://github.com/peter-evans/create-pull-request#action-inputs | <code>${{ github.token }}</code> | **false** |
| **<code>private-access-token</code>** | GitHub private access token for approving & merging pull request. Must be different from github-token. See https://cli.github.com/manual/gh_pr_merge | | **true** |
| **<code>branch</code>** | The pull request branch name | | **true** |
| **<code>title</code>** | The pull request title | | **true** |
| **<code>body</code>** | The pull request body | | **true** |
| **<code>commit-message</code>** | The commit message for the pull request | | **true** |
| **Input** | **Description** | **Default** | **Required** |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ------------ |
| **<code>github-token</code>** | GitHub token for creating and merging pull request (permissions contents: write and pull-requests: write). See [https://github.com/peter-evans/create-pull-request#action-inputs](https://github.com/peter-evans/create-pull-request#action-inputs) | <code>GITHUB_TOKEN</code> | **false** |
| **<code>private-access-token</code>** | GitHub private access token for approving & merging pull request. Must be different from github-token. See [https://cli.github.com/manual/gh_pr_merge](https://cli.github.com/manual/gh_pr_merge) | | **true** |
| **<code>branch</code>** | The pull request branch name | | **true** |
| **<code>title</code>** | The pull request title | | **true** |
| **<code>body</code>** | The pull request body | | **true** |
| **<code>commit-message</code>** | The commit message for the pull request | | **true** |
<!-- end inputs -->
<!-- start outputs -->
Expand Down
Loading

0 comments on commit ef57c0c

Please sign in to comment.