diff --git a/.github/actions/deploy-release-v1/README.md b/.github/actions/deploy-release-v1/README.md new file mode 100644 index 00000000..42ab1c69 --- /dev/null +++ b/.github/actions/deploy-release-v1/README.md @@ -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 diff --git a/.github/actions/deploy-release-v1/action.yml b/.github/actions/deploy-release-v1/action.yml new file mode 100644 index 00000000..416150f9 --- /dev/null +++ b/.github/actions/deploy-release-v1/action.yml @@ -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 }}