HackerRank Validation #6
This file contains hidden or 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
| name: HackerRank Validation | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| targetStack: | |
| description: "Target Stack" | |
| required: true | |
| default: "based_on_current_stack" | |
| type: choice | |
| options: | |
| - based_on_current_stack | |
| - cpp12_1 | |
| - go1_20 | |
| - nodejs18_15 | |
| - nodejs18_15__vuejs | |
| - nodejs18_15__reactjs | |
| - nodejs18_15__angularjs | |
| - java17_0__spring_boot | |
| - java17_0__gradle | |
| - java17_0__maven | |
| - ruby3_2__rails | |
| - python3_11__django | |
| - dotnet6_0 | |
| - spark3_4 | |
| - pyspark3_4 | |
| - php8_2 | |
| - php8_2__codeigniter | |
| - php8_2__symfony | |
| - php8_2__laravel | |
| - expo6_3__react_native | |
| - kotlin1_8_android9477386 | |
| - java17_0_android9477386 | |
| - java21_0__springboot | |
| - java21_0__gradle | |
| - java21_0__maven | |
| - kotlin2_1_android13114758 | |
| - node_22_mongo_8__mern | |
| - node_22_mongo_8__mean | |
| - java21_0_android13114758 | |
| - cpp14 | |
| - java21_0__cucumber | |
| - ruby3_4__rails | |
| - spark3_5 | |
| - pyspark3_5 | |
| - python3_12__django | |
| - php8_4__symfony | |
| - php8_4__laravel | |
| - php8_4__codeigniter | |
| - php8_4 | |
| - dotnet8_0 | |
| - nodejs22_16__vuejs | |
| - nodejs22_16 | |
| - nodejs22_16__angularjs | |
| - nodejs22_16__reactjs | |
| - go1_23 | |
| - jam__java_21__mongo8 | |
| - dam__python3_12__mongo8 | |
| - expo__node_22__react_native | |
| - flutter_web__node22 | |
| - dam__python3_13__mongo8 | |
| - python3_13__django | |
| - go1_26 | |
| - python3_13__flask | |
| - python3_13__flask__psql | |
| - go1_26__mysql8 | |
| - go1_26__mongo8 | |
| - nodejs24 | |
| - nodejs24__reactjs | |
| - nodejs24__angularjs | |
| - nodejs24__vuejs | |
| - java25_0__springboot | |
| - jam__springboot__mongo8 | |
| - java25_0__maven | |
| env: | |
| SOLUTION_TOKEN: ${{ secrets.SOLUTION_TOKEN }} | |
| HACKERRANK_TOKEN: ${{ secrets.QUESTION_TOKEN }} | |
| HACKERRANK_STACKS: ${{ vars.HACKERRANK_STACKS }} | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 7 | |
| steps: | |
| - name: Validate repo | |
| run: | | |
| if [[ $REPO_NAME == [[:digit:]]* ]] | |
| then | |
| echo 'Repo is valid =>' $REPO_NAME | |
| else | |
| echo 'Repo not starting with digit =>' $REPO_NAME | |
| exit 1 | |
| fi | |
| shell: bash | |
| env: | |
| REPO_NAME: ${{ github.event.repository.name }} | |
| - name: Checkout branch | |
| uses: actions/checkout@v6.0.3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6.2.0 | |
| with: | |
| python-version: "pypy3.9" | |
| - run: git archive --format=zip -o project.zip HEAD ':!.github' | |
| name: Create Project zip | |
| - run: pip install -r ./.github/scripts/requirements.txt | |
| name: Install script dependencies | |
| - run: python -u ./.github/scripts/validate.py ${{ github.event.repository.name }} ${{ github.ref_name }} | |
| name: Validate | |
| env: | |
| TARGET_STACK: ${{ inputs.targetStack }} | |
| - name: Find Pull Request | |
| uses: juliangruber/find-pull-request-action@v1.11.0 | |
| id: find-pull-request | |
| with: | |
| branch: ${{ github.ref_name }} | |
| - name: Approve Pull Request if found | |
| uses: juliangruber/approve-pull-request-action@v2.1.0 | |
| if: ${{ steps.find-pull-request.outputs.number != '' }} | |
| with: | |
| github-token: ${{ github.token }} | |
| number: ${{ steps.find-pull-request.outputs.number }} |