Fix failing CLI snapshot test after workflow discovery strategy removal #118
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: Internal - Main - Continuous Integration | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['*'] | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '25 8 * * 1' | |
| permissions: | |
| actions: read | |
| contents: read | |
| issues: read | |
| packages: write | |
| pull-requests: read | |
| security-events: write | |
| statuses: write | |
| # FIXME: This is a workaround for having workflow ref. See https://github.com/orgs/community/discussions/38659 | |
| id-token: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| clean: | |
| uses: hoverkraft-tech/ci-github-container/.github/workflows/prune-pull-requests-images-tags.yml@f9e149b6cdfa8443994994f10085691a57b8cf0e # 0.27.1 | |
| with: | |
| images: '["cli"]' | |
| ci: | |
| uses: ./.github/workflows/__shared-ci.yml | |
| secrets: inherit | |
| with: | |
| sign-images: true | |
| docs-action: | |
| needs: ci | |
| if: github.event_name != 'schedule' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - id: generate-readme | |
| uses: ./ | |
| with: | |
| ci-dokumentor-version: ${{ needs.ci.outputs.image-tag }} | |
| source: action.yml | |
| include-sections: badges,contributing,license,generated | |
| extra-badges: | | |
| [ | |
| { | |
| "label": "Total Downloads", | |
| "url": "https://img.shields.io/npm/dm/@ci-dokumentor/cli", | |
| "linkUrl": "https://www.npmjs.com/package/@ci-dokumentor/cli" | |
| }, | |
| { | |
| "label": "Coverage Status", | |
| "url": "https://codecov.io/gh/hoverkraft-tech/ci-dokumentor/branch/main/graph/badge.svg", | |
| "linkUrl": "https://codecov.io/gh/hoverkraft-tech/ci-dokumentor" | |
| }, | |
| { | |
| "label": "Continuous Integration", | |
| "url": "https://github.com/hoverkraft-tech/ci-dokumentor/actions/workflows/main-ci.yml/badge.svg", | |
| "linkUrl": "https://github.com/hoverkraft-tech/ci-dokumentor/actions/workflows/main-ci.yml" | |
| } | |
| ] | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - id: generate-docs | |
| uses: ./ | |
| with: | |
| ci-dokumentor-version: ${{ needs.ci.outputs.image-tag }} | |
| source: action.yml | |
| destination: packages/docs/content/integrations/github-action.md | |
| include-sections: usage,inputs,outputs,secrets | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| format-link: full | |
| - uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 | |
| id: generate-token | |
| with: | |
| app-id: ${{ vars.CI_BOT_APP_ID }} | |
| private-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }} | |
| - uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@b4883995e100e291a1fed68678d47a560328ed08 # 0.24.0 | |
| with: | |
| github-token: ${{ steps.generate-token.outputs.token }} | |
| branch: docs/action-documentation-update | |
| title: 'docs: update action documentation' | |
| body: Update action documentation | |
| commit-message: | | |
| docs: update action documentation | |
| [skip ci] | |
| npm-publish: | |
| needs: ci | |
| if: github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Setup Node.js | |
| uses: hoverkraft-tech/ci-github-nodejs/actions/setup-node@1d00c9eb280acbee5df4b4a2087f786e66b13d87 # 0.14.1 | |
| - name: Download package tarball | |
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
| with: | |
| name: package-tarball | |
| path: . | |
| - name: Publish CLI to npm | |
| run: | | |
| npm publish ci-dokumentor-cli-*.tgz --provenance --access public --dry-run | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| docs-deploy: | |
| needs: ci | |
| if: github.ref == 'refs/heads/main' && github.event_name != 'schedule' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: hoverkraft-tech/ci-github-publish/actions/deploy/github-pages@6d9e5d48da1a80c085e8ed867d680a5e99b28217 # main | |
| with: | |
| build-path: packages/docs/build | |
| build-artifact-name: build |