Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/reusable-merge-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ on:
value: ${{ jobs.merge-and-push.outputs.sha }}
merged:
description: 'Whether the branches were merged successfully'
value: ${{ jobs.merge-and-push.outputs.merged }}
value: ${{ jobs.push-to-branch.outputs.merged }}

jobs:
merge-and-push:
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
sha: ${{ steps.set-sha.outputs.sha }}
merged: ${{ steps.set-sha.outputs.sha }}
steps:
- name: Check secrets availability
id: check-secrets
Expand Down Expand Up @@ -199,6 +200,7 @@ jobs:
git config --global url."https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Push to Branch (${{ steps.set-push-branch.outputs.push-branch }})
id: push-to-branch
if: ${{ steps.check-update.outputs.changed == '1' && steps.branches-match.outputs.identical != '1' && !inputs.dry-run }}
env:
GH_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
Expand Down
Binary file added Docs/rules.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,31 @@ By starting commit messages with keywords like `feat` or `fix`, they will be aut
If branch or tag protection is enabled, a permission error will occur by default. To bypass this, you can configure GitHub Apps to allow bypassing those protection rules.

- Create a [GitHub App](https://docs.github.com/en/apps/creating-github-apps/about-creating-github-apps/about-creating-github-apps)
- Install the app and configure it for the target repository
- Set `BOT_APP_ID` and `BOT_PRIVATE_KEY` in the repository's Secrets
- Update the protection rules to allow the GitHub App to bypass them

#### GitHub App Permissions

Please configure the following permissions:

| Permissions | Read and write |
|---|---|
| Administration | Read and write |
| Contents | Read and write |
| Metadata | Read-only |
| Pull requests | Read-only |

#### Set Secrets

`Repository > Settings > Secrets and variables > Actions`
![](Docs/bot-setting.jpg)

#### Bypass the App

`Repository > Settings > Rules > Rulesets`
![](Docs/rules.jpg)

## Required Configuration

Enable the **Read and write permissions** setting under `Settings > Actions > General > Workflow permissions`.
Expand Down Expand Up @@ -71,8 +91,6 @@ Navigate to the Actions tab and trigger the manual release by selecting `Run wor
3. If branch protection rules are not used, remove any references to `secrets.BOT_APP_ID` and `secrets.BOT_PRIVATE_KEY`.
4. If permission errors occur while running, configure [permissions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token).

---

## Release via Pull Request

```mermaid
Expand Down Expand Up @@ -111,8 +129,6 @@ A release will be triggered when the following conditions are met:
3. If branch protection rules are not used, remove any references to `secrets.BOT_APP_ID` and `secrets.BOT_PRIVATE_KEY`.
4. If permission errors occur while running, configure [permissions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token).

---

## Recommendation

Even when using the pull request release method, it is advisable to configure the manual release option as a fallback mechanism. Otherwise, creating new pull requests will be the only way to create releases.
Loading