-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PWA-1219: Reusable Deployment Workflow (#76)
* Add package * Add docs * Change input token * Update input namespace * Fix composition structure * Remove env * Fix indent * Fix composite * Fix composition * Composition * Add shell * Shell * Update token input * Input naming/docs * Remove actor
- Loading branch information
1 parent
518f323
commit a01d407
Showing
4 changed files
with
103 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
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
"auth0-remove-origin", | ||
"twistlock", | ||
"start-and-check", | ||
"web-create-release-pr", | ||
"core/*" | ||
] | ||
}, | ||
|
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,24 @@ | ||
# Web - Create Release PR | ||
|
||
Creates a release candidate branch and pull request (PR) | ||
|
||
## Usage | ||
|
||
```yaml | ||
name: Prod - Create Release Candidate | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | ||
|
||
jobs: | ||
create-release-pr: | ||
uses: resideo/actions/web-create-release-pr@master | ||
with: | ||
fromBranch: stage | ||
toBranch: master | ||
rcBranchPrefix: release | ||
prLabel: Prod Release | ||
``` |
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,77 @@ | ||
name: Create Release Candidate | ||
|
||
inputs: | ||
fromBranch: | ||
description: 'Source branch name. Ex: develop' | ||
required: true | ||
type: string | ||
toBranch: | ||
description: 'Destination branch name. Ex: stage' | ||
required: true | ||
type: string | ||
rcBranchPrefix: | ||
description: 'RC branch prefix name. Ex: stage-release' | ||
required: true | ||
type: string | ||
prLabel: | ||
description: 'Pull request label. Ex: STAGE RELEASE' | ||
required: true | ||
type: string | ||
githubToken: | ||
description: 'GITHUB_TOKEN' | ||
default: '${{ github.token }}' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout ๐๏ธ | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ inputs.githubToken }} | ||
|
||
- uses: volta-cli/action@v1 | ||
|
||
- name: Set RC Branch Name | ||
shell: bash | ||
run: echo "rc_branch=$(date +${{ inputs.rcBranchPrefix }}/%Y.%m.%d.%H%M)" >> $GITHUB_ENV | ||
|
||
- name: Create RC Branch ๐ | ||
shell: bash | ||
run: | | ||
git fetch --all --unshallow | ||
git checkout ${{ inputs.fromBranch }} | ||
git pull | ||
git checkout ${{ inputs.toBranch }} | ||
git checkout -b ${{ env.rc_branch }} | ||
git merge ${{ inputs.fromBranch }} | ||
git push --set-upstream origin ${{ env.rc_branch }} | ||
- name: Generate Pull Request Body | ||
shell: bash | ||
run: | | ||
echo "๐ An automated PR to merge *${{ inputs.fromBranch }}* to *${{ inputs.toBranch }}* ๐" > pr_msg | ||
- name: Get Pull Request Body | ||
id: vars | ||
shell: bash | ||
run: echo ::set-output name=pr_body::$(cat pr_msg) | ||
|
||
- name: Create Pull Request ๐ | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
source_branch: ${{ env.rc_branch }} | ||
destination_branch: ${{ inputs.toBranch }} | ||
pr_title: '(Stage) ${{ env.rc_branch }} ' | ||
pr_body: ${{ steps.vars.outputs.pr_body }} | ||
pr_label: ${{ inputs.prLabel }} | ||
|
||
- name: Get Pull Request Number | ||
id: pr-number | ||
shell: bash | ||
run: echo "pull_request_number=$(gh pr view --json number -q .number || echo "")" >> $GITHUB_OUTPUT | ||
|
||
- name: Comment on Pull Request | ||
id: pr-comment | ||
shell: bash | ||
run: | | ||
gh pr comment ${{ steps.pr-number.outputs.pull_request_number }} --body "Merge this PR manually by selecting '**Create a merge commit**' *not* 'Squash and merge'" |