diff --git a/.github/workflows/review-build-url-v2.yml b/.github/workflows/review-build-url-v2.yml new file mode 100644 index 0000000..4d7d21d --- /dev/null +++ b/.github/workflows/review-build-url-v2.yml @@ -0,0 +1,22 @@ +name: Post Review Build URL to PR +on: + pull_request: + types: [opened] +jobs: + example: + name: Post to PR + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - id: get-branch-name-sanitized + name: Sanitize branch name + shell: bash + run: echo "::set-output name=branch::$(jq --raw-output .pull_request.head.ref "$GITHUB_EVENT_PATH" | tr -cd '[a-zA-Z0-9]-' | cut -b 1-40)" + - name: Post Review Build URL + if: startsWith(steps.get-branch-name-sanitized.outputs.branch, 'feature') + uses: unsplash/comment-on-pr@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + msg: "Branch name is correct" + check_for_duplicate_msg: true diff --git a/.github/workflows/review-build-url.yml b/.github/workflows/review-build-url.yml new file mode 100644 index 0000000..61e5644 --- /dev/null +++ b/.github/workflows/review-build-url.yml @@ -0,0 +1,17 @@ + +name: Post Review Build URL to PR +on: + pull_request: + types: [opened] +jobs: + branch_name: + runs-on: ubuntu-latest + name: Branch Name + steps: + - uses: actions/checkout@v2 + with: + branch_pattern: 'feature' + comment_for_invalid_branch_name: 'This branch name is not following the standards. Name should start with feature/' + fail_if_invalid_branch_name: 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}