diff --git a/.github/helpers/.gitignore b/.github/helpers/.gitignore new file mode 100644 index 000000000..25c8fdbab --- /dev/null +++ b/.github/helpers/.gitignore @@ -0,0 +1,2 @@ +node_modules +package-lock.json \ No newline at end of file diff --git a/.github/helpers/package.json b/.github/helpers/package.json new file mode 100644 index 000000000..aca5c0399 --- /dev/null +++ b/.github/helpers/package.json @@ -0,0 +1,16 @@ +{ + "name": "helpers", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "axios": "^0.26.1", + "github-workflow-helpers": "github:supertokens/github-workflow-helpers" + } +} diff --git a/.github/workflows/pre-commit-hook-run.yml b/.github/workflows/pre-commit-hook-run.yml new file mode 100644 index 000000000..e51447bdb --- /dev/null +++ b/.github/workflows/pre-commit-hook-run.yml @@ -0,0 +1,24 @@ +name: "Pre commit hook check" + +on: + pull_request: + types: + - opened + - reopened + - edited + - synchronize + +jobs: + pr-title: + name: Pre commit hook check + runs-on: ubuntu-latest + container: rishabhpoddar/supertokens_website_sdk_testing + steps: + - uses: actions/checkout@v2 + - name: Set up node + uses: actions/setup-node@v1 + with: + node-version: "16" + - run: git init && git add --all && git -c user.name='test' -c user.email='test@example.com' commit -m 'init for pr action' + - run: npm i + - run: ./hooks/pre-commit.sh diff --git a/.github/workflows/tests-pass-check-pr.yml b/.github/workflows/tests-pass-check-pr.yml new file mode 100644 index 000000000..cfa2cbaec --- /dev/null +++ b/.github/workflows/tests-pass-check-pr.yml @@ -0,0 +1,24 @@ +name: 'Check if "Run tests" action succeeded' + +on: + pull_request: + types: + - opened + - reopened + - edited + - synchronize + +jobs: + pr-run-test-action: + name: Check if "Run tests" action succeeded + timeout-minutes: 60 + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: node install + run: cd ./.github/helpers && npm i + - name: Calling github API + run: cd ./.github/helpers && GITHUB_TOKEN=${{ github.token }} REPO=${{ github.repository }} RUN_ID=${{ github.run_id }} BRANCH=${{ github.head_ref }} JOB_ID=${{ github.job }} SOURCE_OWNER=${{ github.event.pull_request.head.repo.owner.login }} CURRENT_SHA=${{ github.event.pull_request.head.sha }} node node_modules/github-workflow-helpers/test-pass-check-pr.js