-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(.github/action): add deploy-release github action
- Loading branch information
1 parent
19356cc
commit 51d09dc
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# deploy-release-v1 | ||
|
||
A GitHub Action to label all related issues with the package version and create a PR to sync branches | ||
|
||
## Inputs | ||
|
||
| Name | Required | Description | Default | | ||
| ------------------- | -------- | -------------------------------------------- | ------- | | ||
| `token` | Yes | A GitHub token with the required permissions | NA | | ||
| `project-number` | No | A project number of the project board | 66 | | ||
| `head` | No | A head branch to sync from | main | | ||
| `base` | No | A target branch for the created pull request | develop | | ||
| `pr-team-reviewers` | No | Reviewers to tag on the created pull request | NA | | ||
|
||
## Example usage | ||
|
||
```yaml | ||
name: Deploy release | ||
|
||
jobs: | ||
deploy-release: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 7 | ||
steps: | ||
- uses: dequelabs/axe-api-team-public/.github/actions/deploy-release-v1@main | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
project-number: '66' | ||
head: main | ||
base: develop | ||
pr-team-reviewers: axe-api-team | ||
env: | ||
# Required for the GH CLI | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
## Permissions | ||
This action requires the following permission scopes: | ||
- `repository-projects: read` - To move issues into a project | ||
- `issues: write` - To add a label into an issue | ||
- `contents: read` - To work with the contents of the repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: deploy-release-v1 | ||
description: Label all related issues with the package version and create a PR to sync branches | ||
|
||
inputs: | ||
token: | ||
description: 'A GitHub token with the required permissions' | ||
required: true | ||
project-number: | ||
description: 'A project number of the project board' | ||
required: false | ||
default: '66' | ||
head: | ||
description: 'A head branch to sync from' | ||
required: false | ||
default: main | ||
base: | ||
description: 'A target branch for the created pull request' | ||
required: false | ||
default: develop | ||
pr-team-reviewers: | ||
description: 'Reviewers to tag on the created pull request' | ||
required: false | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Fetch all history | ||
fetch-depth: 0 | ||
- uses: dequelabs/axe-api-team-public/.github/actions/get-package-version-v1@main | ||
id: get-package-version | ||
- uses: dequelabs/axe-api-team-public/.github/actions/generate-commit-list-v1@main | ||
id: get-commit-list | ||
with: | ||
tag: v${{ steps.get-package-version.outputs.version }} | ||
- uses: dequelabs/axe-api-team-public/.github/actions/label-and-move-released-issues-v1@main | ||
with: | ||
commit-list: ${{ steps.get-commit-list.outputs.commit-list }} | ||
version: ${{ steps.get-package-version.outputs.version }} | ||
token: ${{ inputs.token }} | ||
project-number: ${{ inputs.project-number }} | ||
- uses: dequelabs/action-sync-branches@master | ||
with: | ||
github-token: ${{ inputs.token }} | ||
pr-title: 'chore: merge ${{ inputs.head }} into ${{ inputs.base }}' | ||
pr-body: 'Remember to _merge_ (rather than squash) this PR! Also, auto-merge does not work because many of the required checks do not run on the `${{ inputs.head }}` branch.' | ||
pr-team-reviewers: ${{ inputs.pr-team-reviewers }} | ||
head: ${{ inputs.head }} | ||
base: ${{ inputs.base }} |