chore(deps): update github/codeql-action action to v2.22.12 (#91) #193
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: build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
IMAGE_NAME: ghcr.io/maxbrunet/renovate-approve-job | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 2 | |
- name: Enable corepack | |
run: corepack enable pnpm | |
- name: Set up Node.js | |
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- name: Enable corepack | |
run: corepack enable pnpm | |
- name: Install Node.js dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Lint | |
run: pnpm run lint | |
codeql-analyze: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 2 | |
- name: Enable corepack | |
run: corepack enable pnpm | |
- name: Set up Node.js | |
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- name: Enable corepack | |
run: corepack enable pnpm | |
- name: Install Node.js dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@1500a131381b66de0c52ac28abb13cd79f4b7ecc # v2.22.12 | |
with: | |
languages: javascript | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@1500a131381b66de0c52ac28abb13cd79f4b7ecc # v2.22.12 | |
build: | |
needs: [codeql-analyze, lint] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
issues: write | |
packages: write | |
pull-requests: write | |
timeout-minutes: 10 | |
steps: | |
# full checkout for semantic-release | |
- name: Checkout repository | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 | |
- name: Enable corepack | |
run: corepack enable pnpm | |
- name: Set up Node.js | |
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- name: Enable corepack | |
run: corepack enable pnpm | |
- name: Install Node.js dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get commit timestamp | |
id: git-commit-ts | |
run: | | |
TS="$(git log -1 --pretty=%ct)" | |
printf 'ts=%s\n' "${TS}" >"${GITHUB_OUTPUT}" | |
- name: Build container images | |
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 | |
env: | |
SOURCE_DATE_EPOCH: ${{ steps.git-commit-ts.outputs.ts }} | |
with: | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ env.IMAGE_NAME }}:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: semantic-release | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push container images | |
if: ${{ env.IMAGE_TAG != '' }} | |
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
# IMAGE_TAG is set by @semantic-release/exec (see .releaserc file) | |
tags: | | |
${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} | |
${{ env.IMAGE_NAME }}:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |