Repository navigation
fix(ci): handle workflows publishing issue (#67) #5
This file contains hidden or 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: Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| message: | |
| type: string | |
| description: 'Overrides the publish commit subject. A publish is a snapshot, so when several commits piled up since the last run the newest subject alone undersells them.' | |
| required: false | |
| default: '' | |
| permissions: {} | |
| concurrency: | |
| group: publish | |
| jobs: | |
| publish: | |
| name: Publish | |
| runs-on: ubuntu-slim | |
| environment: release-branch | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| with: | |
| # GITHUB_TOKEN cannot create or update files under .github/workflows -- | |
| # the `workflows` permission is not grantable to it. The release branch | |
| # carries repository-check.yml, so the push needs a PAT that has it. | |
| token: ${{ secrets.RELEASE_BRANCH_TOKEN }} | |
| - name: Setup PNPM | |
| uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version-file: '.node-version' | |
| cache: 'pnpm' | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build and place publishable artifacts | |
| run: pnpm dist | |
| - name: Publish to release branch | |
| env: | |
| BRANCH: release | |
| SHA: ${{ github.sha }} | |
| MESSAGE: ${{ inputs.message }} | |
| GIT_USER_NAME: ${{ github.actor }} | |
| GIT_USER_EMAIL: ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com | |
| WORKFLOW_FILES: repository-check.yml | |
| ACTION_DIRS: | | |
| get-changed-files | |
| pr-filter | |
| send-teams-notification | |
| validate-sbom | |
| verify-version-change | |
| install-internal-package | |
| lgtm | |
| validate-lock-files | |
| validate-node-versions | |
| pnpm-audit | |
| TAGS: | | |
| get-changed-files | |
| pr-filter | |
| send-teams-notification | |
| validate-sbom | |
| verify-version-change | |
| install-internal-package | |
| lgtm | |
| repository-check | |
| run: ./scripts/publish-actions.sh |