Skip to content

fix: improve startup performance by unifying queries for pg policies and roles #154

fix: improve startup performance by unifying queries for pg policies and roles

fix: improve startup performance by unifying queries for pg policies and roles #154

Workflow file for this run

name: Publish beta package
on:
pull_request:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
# Only run this job if the PR is from a trusted collaborator (i.e. not a fork)
if: github.event.pull_request.head.repo.full_name == github.repository
env:
CEREBRUM_NPM_TOKEN: ${{ secrets.CEREBRUM_NPM_TOKEN }}
steps:
# Checkout project repository
- name: Checkout
uses: actions/checkout@v3.5.0
# Setup Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org/
node-version: 20
# Use a cache for dependencies
- uses: actions/cache@v3.3.1
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
# Install dependencies so that prepublish scripts work as expected
- name: Install deps
run: npm i
# Update package version to a beta release, including the git commit sha
- name: Bump package.json
run: |
npm --no-git-tag-version version $(npm show . version)-beta.dangerous.$(git rev-parse --short HEAD)
echo "BETA_PACKAGE_VERSION=$(npm show . version)-beta.dangerous.$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# Publish version to npm
- name: Publish beta package
run: npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.CEREBRUM_PUBLISH_NPM_TOKEN }}
# Add comment to PR with beta package version
- name: Find comment
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: "Published beta package version:"
direction: first
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v1
if: steps.fc.outputs.comment-id == ''
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Published beta package version: `${{ env.BETA_PACKAGE_VERSION }}`