-
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 (#157)
* ci(.github/action): add deploy-release github action * ci(.github/action): rename the deploy-release action to move-released-issues-and-create-sync-pr. Add a default value of the input pr-team-reviewers * ci(.github/action): change a step to get a previous tag in the move-released-issues-and-create-sync-pr action * ci(.github/action): remove checkout step in the move-released-issues-and-create-sync-pr action * ci(.github/action): change README.md of the move-released-issues-and-create-sync-pr action
- Loading branch information
1 parent
19356cc
commit 2fb4a2a
Showing
2 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
.github/actions/move-released-issues-and-create-sync-pr-v1/README.md
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,47 @@ | ||
# move-released-issues-and-create-sync-pr-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 | axe-api-team | | ||
|
||
## Example usage | ||
|
||
```yaml | ||
name: Deploy release | ||
|
||
jobs: | ||
move-released-issues-and-create-sync-pr: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 7 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Fetch all history | ||
fetch-depth: 0 | ||
- uses: dequelabs/axe-api-team-public/.github/actions/move-released-issues-and-create-sync-pr-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 |
56 changes: 56 additions & 0 deletions
56
.github/actions/move-released-issues-and-create-sync-pr-v1/action.yml
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,56 @@ | ||
name: move-released-issues-and-create-sync-pr-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 | ||
default: axe-api-team | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Get the previous tag prior to the latest | ||
id: get-previous-tag | ||
shell: bash | ||
run: | | ||
TAG=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1)) | ||
# Remove "v" prefix | ||
TAG_VERSION=${TAG#v} | ||
echo "tag=$TAG" >> $GITHUB_OUTPUT | ||
echo "tag-version=$TAG_VERSION" >> $GITHUB_OUTPUT | ||
- uses: dequelabs/maksym-testing/.github/actions/generate-commit-list-v1@develop | ||
id: get-commit-list | ||
with: | ||
tag: ${{ steps.get-previous-tag.outputs.tag }} | ||
- 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-previous-tag.outputs.tag-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 }} |