fix: snyk issue in code linter #555
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: ci | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
skip_coveralls: | |
description: "Skip coveralls" | |
type: boolean | |
default: false | |
skip_gas: | |
description: "Skip push" | |
type: boolean | |
default: false | |
skip_release: | |
description: "Skip release" | |
type: boolean | |
default: true | |
skip_sonarcloud: | |
description: "Skip sonarcloud" | |
type: boolean | |
default: false | |
skip_tests: | |
description: "Skip tests" | |
type: boolean | |
default: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
new_gas_version: ${{ steps.push-gas.outputs.new_gas_version }} | |
pages_version: main # Simplified, as release-please handles versioning | |
do_push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
environment: | |
name: main | |
env: | |
CLASP_ACCESS_TOKEN: ${{secrets.CLASP_ACCESS_TOKEN}} | |
CLASP_CLIENT_ID: ${{secrets.CLASP_CLIENT_ID}} | |
CLASP_CLIENT_SECRET: ${{secrets.CLASP_CLIENT_SECRET}} | |
CLASP_EXAMPLES_DEPLOYMENT_ID: ${{secrets.CLASP_EXAMPLES_DEPLOYMENT_ID}} | |
CLASP_EXAMPLES_SCRIPT_ID: ${{secrets.CLASP_EXAMPLES_SCRIPT_ID}} | |
CLASP_ID_TOKEN: ${{secrets.CLASP_ID_TOKEN}} | |
CLASP_LIB_DEPLOYMENT_ID: ${{secrets.CLASP_LIB_DEPLOYMENT_ID}} | |
CLASP_LIB_SCRIPT_ID: ${{secrets.CLASP_LIB_SCRIPT_ID}} | |
CLASP_REFRESH_TOKEN: ${{secrets.CLASP_REFRESH_TOKEN}} | |
GCLOUD_PROJECT_ID: ${{secrets.GCLOUD_PROJECT_ID}} | |
GCLOUD_PROJECT_NR: ${{secrets.GCLOUD_PROJECT_NR}} | |
steps: | |
- id: checkout | |
name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 # Use v3 or later | |
with: | |
persist-credentials: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fetch-depth: 0 | |
- id: nodejs | |
name: Use Node.js | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 # Use v3 or later | |
with: | |
node-version: 22.x | |
cache: "npm" | |
- id: build | |
name: Build | |
run: npm run ci:build | |
- id: test | |
if: ${{ !github.event.inputs.skip_tests }} | |
name: Test | |
run: npm run ci:test | |
- id: docs | |
name: Build docs | |
run: npm run ci:docs | |
- name: Release Please | |
if: ${{ !github.event.inputs.skip_release }} | |
id: release | |
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4 | |
with: | |
release-type: node # Or the appropriate release type for your project | |
- id: coveralls | |
if: ${{ !github.event.inputs.skip_coveralls }} | |
name: Coveralls | |
uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2 | |
- id: sonarcloud | |
if: ${{ !github.event.inputs.skip_sonarcloud }} | |
name: SonarCloud Scan | |
uses: SonarSource/sonarqube-scan-action@bfd4e558cda28cda6b5defafb9232d191be8c203 # v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
# SONAR_PROJECT_VERSION: ${{ steps.release-status.outputs.new_release_published == 'true' && steps.release-status.outputs.new_release_version || '' }} Remove this line | |
- id: push-gas | |
if: ${{ !github.event.inputs.skip_gas }} | |
name: Push to GAS | |
run: | | |
npm run push | |
echo "new_gas_version=$(cat build/gas/lib-version.txt)" >> "${GITHUB_OUTPUT}" | |
- id: deploy-lib | |
if: ${{ !github.event.inputs.skip_release && steps.release.outputs.release_created }} # Check if a release was created | |
name: Deploy Lib | |
run: npm run deploy | |
env: | |
CLASP_DEPLOYMENT_NAME: ${{ steps.release.outputs.tag_name }} # Use the tag name from release-please | |
- id: update-release-notes | |
if: ${{ !github.event.inputs.skip_release && steps.release.outputs.release_created }} # Check if a release was created | |
name: Update Release Notes | |
run: | | |
npm run release:update | |
env: | |
CLASP_DEPLOYMENT_NAME: ${{ steps.release.outputs.tag_name }} # Use the tag name from release-please | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |