Skip to content

fix: custom action name regex + add test #449

fix: custom action name regex + add test

fix: custom action name regex + add test #449

Workflow file for this run

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: false
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 }}
new_release_published: ${{ steps.release.outputs.new_release_published }}
new_release_version: ${{ steps.release.outputs.new_release_version }}
pages_version: ${{ steps.release-status.outputs.new_release_published == 'true' && steps.release-status.outputs.new_release_version || 'main' }}
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
persist-credentials: false
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- id: nodejs
name: Use Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: 20.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
- id: release-status
if: ${{ !github.event.inputs.skip_release }}
name: Release Status
uses: cycjimmy/semantic-release-action@cb425203a562475bca039ba4dbf90c7f9ac790f4 # v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
dry_run: true
- id: coveralls
if: ${{ !github.event.inputs.skip_coveralls }}
name: Coveralls
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 # v2
- id: sonarcloud
if: ${{ !github.event.inputs.skip_sonarcloud }}
name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@4006f663ecaf1f8093e8e4abb9227f6041f52216 # v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_PROJECT_VERSION: ${{ steps.release-status.outputs.new_release_published == 'true' && steps.release-status.outputs.new_release_version || '' }}
- 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: release
if: ${{ !github.event.inputs.skip_release }}
name: Release
uses: cycjimmy/semantic-release-action@cb425203a562475bca039ba4dbf90c7f9ac790f4 # v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: deploy-lib
if: ${{ !github.event.inputs.skip_release && !github.event.inputs.skip_release && steps.release.outputs.new_release_published == 'true' }}
name: Deploy Lib
run: npm run deploy
env:
CLASP_DEPLOYMENT_NAME: ${{ steps.release.outputs.new_release_version }}
- id: update-release-notes
if: ${{ !github.event.inputs.skip_release && steps.release.outputs.new_release_published == 'true' }}
name: Update Release Notes
run: |
npm run release:update
env:
CLASP_DEPLOYMENT_NAME: ${{ steps.release.outputs.new_release_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}