USER04 - Create an API with an endpoint that gives the list of registered users #283
Workflow file for this run
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
name: "Test" | |
on: | |
pull_request_target: | |
branches: [main] | |
jobs: | |
authorize: | |
environment: | |
${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} | |
runs-on: ubuntu-latest | |
steps: | |
- run: true | |
test: | |
needs: authorize | |
runs-on: ubuntu-latest | |
env: | |
PUBLIC_FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} | |
PUBLIC_FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }} | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/github-script@v7 | |
id: pr | |
with: | |
script: | | |
const { data: pullRequest } = await github.rest.pulls.get({ | |
...context.repo, | |
pull_number: context.payload.pull_request.number, | |
}); | |
return pullRequest | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{fromJSON(steps.pr.outputs.result).merge_commit_sha}} | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 8.14.3 | |
- name: "Install Node" | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: "pnpm" | |
- name: "Install Deps" | |
run: pnpm i --frozen-lockfile | |
- name: "Test" | |
run: pnpm run test --coverage.enabled true | |
- name: "Upload Coverage" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
path: coverage |