This is a reusable GitHub Actions workflow that creates a pull request with git-pr-release.
Once this workflow creates a pull request, it notifies you on Slack.
- Create a Slack Webhook URL from https://api.slack.com/apps.
- Set the Slack Webhook URL as a GitHub Actions secrets.
- Add a workflow configuration file as like the following examples into you repository.
That's it!
If you want to run the workflow at 04:00 UTC on every Monday, Tuesday, Wednesday, Thursday, and Friday, the following example works.
name: release-pr
on:
schedule:
- cron: '0 4 * * 1,2,3,4,5'
jobs:
call-workflow-passing-data:
uses: smartbank-inc/release-pr-workflow/.github/workflows/release-pr.yml@main
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
If you want to run the workflow manually, the following example works.
name: release-pr
on:
workflow_dispatch:
inputs:
override:
description: 'If you want to override the existing pull request, enter "true"'
required: false
default: ''
jobs:
call-workflow-passing-data:
uses: smartbank-inc/release-pr-workflow/.github/workflows/release-pr.yml@main
with:
override: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.override == 'true' }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
Name | Required | Default | Description |
---|---|---|---|
git_pr_release_branch_staging | false |
release |
The branch name that the feature branches are merged into and is going to be merged into the "production" branch. |
git_pr_release_branch_production | false |
main |
The branch name that is deployed in production environment. |
git_pr_release_template | false |
.git-pr-release-template |
The template file path (relative to the workidir top) for pull requests created. Its first line is used for the PR title, the rest for the body. This is an ERB template. |
override | false |
false |
If this value is true, this workflow overrides an existing branch and a pull request. If its' false, this workflow checks branch existence (If exists, stop to create a branch). |
Name | Required | Default | Description |
---|---|---|---|
token | true |
- | GitHub token to be used for all git operations. |
slack_webhook | true |
- | Slack Webhook URL. The URL is associated with a channel to be notified. |