chore(deps): update linters to v6.16.0 #1272
Workflow file for this run
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': | |
pull_request: | |
types: [opened, synchronize] | |
push: | |
branches: [main, 'renovate/**'] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: 'bash -Eeuxo pipefail {0}' | |
jobs: | |
setup: | |
name: Setup | |
outputs: | |
dist-changed: ${{ contains(steps.filter.outputs.changes, 'dist-changed') }} | |
node-version: ${{ steps.set-node-version.outputs.node-version }} | |
should-lint: ${{ contains(steps.filter.outputs.changes, 'should-lint') }} | |
src-changed: ${{ contains(steps.filter.outputs.changes, 'src-changed') }} | |
permissions: | |
pull-requests: read | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0 | |
- id: set-node-version | |
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 | |
with: | |
cache: pnpm | |
node-version-file: '.node-version' | |
- run: pnpm install --frozen-lockfile | |
- id: filter | |
uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1 | |
with: | |
filters: | | |
config: &config | |
- .github/** | |
- '**.json5?' | |
- '**.md' | |
- '**.yaml' | |
- '**.yml' | |
dist-changed: | |
- added|modified: 'dist/**' | |
src-changed: &src-changed | |
- __tests__/** | |
- src/** | |
- action.yaml | |
- package.json | |
should-lint: | |
- added|modified: *config | |
- added|modified: *src-changed | |
lint: | |
if: ${{ needs.setup.outputs.should-lint == 'true' }} | |
name: Lint | |
needs: [setup] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0 | |
- name: Setup Node.js | |
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 | |
with: | |
cache: pnpm | |
node-version: ${{ needs.setup.outputs.node-version }} | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm check-format | |
- run: pnpm lint | |
build: | |
if: ${{ github.ref == 'refs/heads/main' || needs.setup.outputs.src-changed == 'true' }} | |
name: Build | |
needs: [setup] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0 | |
- name: Setup Node.js | |
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 | |
with: | |
cache: pnpm | |
node-version: ${{ needs.setup.outputs.node-version }} | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Rebuild the dist/ directory | |
run: pnpm build | |
- if: ${{ needs.setup.outputs.dist-changed == 'true' }} | |
name: Compare the expected and actual dist/ directories | |
run: | | |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then | |
echo "Detected uncommitted changes after build. See status below:" | |
git diff --text | |
exit 1 | |
fi | |
id: diff | |
# If index.js was different than expected, upload the expected version as an artifact | |
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 | |
if: ${{ failure() && steps.diff.conclusion == 'failure' }} | |
with: | |
name: dist | |
path: dist/ | |
test: | |
name: Test | |
needs: [setup] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0 | |
- name: Setup Node.js | |
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 | |
with: | |
cache: pnpm | |
node-version: ${{ needs.setup.outputs.node-version }} | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- run: pnpm test | |
- uses: ./ | |
with: | |
milliseconds: 1000 | |
dependency-review: | |
if: ${{ github.event_name == 'pull_request' }} | |
name: Dependency Review | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Dependency Review | |
uses: actions/dependency-review-action@01bc87099ba56df1e897b6874784491ea6309bc4 # v3.1.4 | |
release: | |
env: | |
DRY_RUN: ${{ github.ref_name != github.event.repository.default_branch }} | |
FORCE_COLOR: true | |
name: Release | |
needs: [setup, lint, test, build] | |
outputs: | |
commit: ${{ steps.merge.outputs.commit }} | |
version: ${{ steps.semantic-release.outputs.version }} | |
runs-on: ubuntu-latest | |
steps: | |
- id: get-workflow-access-token | |
name: Get Workflow Access Token | |
uses: peter-murray/workflow-application-token-action@8e1ba3bf1619726336414f1014e37f17fbadf1db # v2.1.0 | |
with: | |
application_id: ${{ secrets.APPLICATION_ID }} | |
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }} | |
permissions: 'contents:write, issues:write, pull_requests:write' | |
- name: Setup Git user | |
run: | | |
git config --global user.email '118100583+bfra-me[bot]@users.noreply.github.com' | |
git config --global user.name 'bfra-me[bot]' | |
- name: Checkout `release` branch | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 | |
ref: release | |
token: ${{ steps.get-workflow-access-token.outputs.token }} | |
- if: ${{ github.event_name == 'pull_request' }} | |
name: Fetch PR | |
run: git fetch origin +${{ github.sha }}:${{ github.ref }} | |
- id: merge | |
name: Merge `main` into `release` | |
run: | | |
git merge --no-ff -Xtheirs -m 'skip: merge (${{ github.sha }}) [skip release]' ${{ github.sha }} | |
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm | |
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0 | |
- name: Setup Node.js | |
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 | |
with: | |
cache: pnpm | |
node-version: ${{ needs.setup.outputs.node-version }} | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- if: env.DRY_RUN != 'true' | |
name: Push `release` branch | |
run: git push origin release:release | |
- env: | |
GIT_AUTHOR_EMAIL: '118100583+bfra-me[bot]@users.noreply.github.com' | |
GIT_AUTHOR_NAME: 'bfra-me[bot]' | |
GIT_COMMITTER_EMAIL: '118100583+bfra-me[bot]@users.noreply.github.com' | |
GIT_COMMITTER_NAME: 'bfra-me[bot]' | |
GITHUB_TOKEN: ${{ steps.get-workflow-access-token.outputs.token }} | |
id: semantic-release | |
name: Semantic Release | |
run: | | |
export GITHUB_REF=refs/heads/release GITHUB_SHA=${{ steps.merge.outputs.commit }} | |
pnpm semantic-release --dry-run ${{ env.DRY_RUN }} --ci ${{ env.DRY_RUN != 'true' }} |