Skip to content

Commit

Permalink
ci: add auto approve validation
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Oct 6, 2023
1 parent 310de11 commit f8652dd
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 7 deletions.
54 changes: 47 additions & 7 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,56 @@
name: 🤖 Auto approve by bot
name: 🤖 Auto approve validation
on: pull_request

env:
PR_JOBS_NAME:
'[ "Packages", "Demo", "Firebase", "typecheck", "cspell", "prettier", "stylelint", "eslint", "tests", "E2E result" ]'
RELEASE_JOBS_NAME: '[ "Publish" ]'

jobs:
automated-pull-request:
setup:
runs-on: ubuntu-latest
permissions:
pull-requests: write
outputs:
matrix: ${{ steps.matrix.outputs.value }}
steps:
- uses: actions/checkout@v4.1.0
- uses: taiga-family/ci/actions/setup/[email protected].7
- uses: taiga-family/ci/actions/auto/approve/[email protected]
- uses: taiga-family/ci/actions/setup/checkout@v1.25.8
- uses: taiga-family/ci/actions/setup/[email protected].8
- id: matrix
if: env.TAIGA_FAMILY_BOT_IS_AUTHOR == 'true'
run: |
if [[ "${{ env.IS_RELEASE_BRANCH }}" == "false" ]]; then
echo "value=$PR_JOBS_NAME" >> $GITHUB_OUTPUT
else
echo "value=$RELEASE_JOBS_NAME" >> $GITHUB_OUTPUT
fi
wait:
needs: [setup]
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
value: ${{ fromJSON(needs.setup.outputs.matrix) }}
steps:
- uses: taiga-family/ci/actions/run/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
job: ${{ matrix.value }}

approve:
needs: [wait]
runs-on: ubuntu-latest
steps:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/auto/approve/[email protected]
with:
token1: ${{ secrets.GITHUB_TOKEN }}
token2: ${{ secrets.TAIGA_FAMILY_APPROVE_BOT_PAT }}
- uses: taiga-family/ci/actions/run/[email protected]
if: env.IS_RELEASE_BRANCH == 'false'
with:
token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }}

concurrency:
group: auto-approve-${{ github.head_ref }}
cancel-in-progress: true
9 changes: 9 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ jobs:
run:
npm run cy:run -- --spec "**/(angular|react|ssr|addons|others)/**/*.cy.ts" --config baseUrl="${{
env.UNIVERSAL_SERVER }}"

result:
if: ${{ !contains(github.head_ref, 'release/') }}
needs: [build-demo, e2e-kit, e2e-recipes, e2e-others]
runs-on: ubuntu-latest
name: E2E result
steps:
- run: echo "Success"

concurrency:
group: e2e-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
1 change: 1 addition & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
Expand Down

0 comments on commit f8652dd

Please sign in to comment.