Skip to content

chore(deps): update actions/checkout action to v4.2.1 #152

chore(deps): update actions/checkout action to v4.2.1

chore(deps): update actions/checkout action to v4.2.1 #152

name: "Preview Release"
on: # yamllint disable-line rule:truthy
# eslint-disable-next-line yml/no-empty-mapping-value
pull_request: # yamllint disable-line rule:empty-values
permissions:
contents: "read" # to fetch code (actions/checkout)
env:
NX_BRANCH: "${{ github.event.number }}"
NX_RUN_GROUP: "${{ github.run_id }}"
HEAD_REF: "${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}"
HEAD_REPOSITORY: "${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }}"
jobs:
preview:
name: "Preview Release"
if: "github.repository == 'visulima/visulima'"
runs-on: "ubuntu-latest"
permissions:
contents: "write"
issues: "write"
checks: "write"
pull-requests: "write"
steps:
- name: "Harden Runner"
uses: "step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6" # v2.8.1
with:
egress-policy: "audit"
- name: "Git checkout"
uses: "actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871" # v4.2.1
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags.
# Pulls all commits (needed for NX)
fetch-depth: 0
env:
GIT_COMMITTER_NAME: "GitHub Actions Shell"
GIT_AUTHOR_NAME: "GitHub Actions Shell"
EMAIL: "github-actions[bot]@users.noreply.github.com"
- name: "Derive appropriate SHAs for base and head for `nx affected` commands"
id: "setSHAs"
uses: "nrwl/nx-set-shas@be2a36618456ad6f3abf921eb24900817da1af6b" # v4
- name: "Setup resources and environment"
id: "setup"
uses: "anolilab/workflows/step/setup@main"
with:
node-version: "18.x"
cache-prefix: "preview-release"
# Temporary solution until Nx solve this https://github.com/nrwl/nx/issues/22259
- name: "Get changed files"
id: "files"
uses: "tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c" # v44.5.7
with:
files_ignore_from_source_file: ".github/ignore-files-for-nx-affected.yml"
base_sha: "${{ steps.setSHAs.outputs.base }}"
separator: ","
- name: "Build"
shell: "bash"
run: |
files="${{ steps.files.outputs.all_changed_files }}";
pnpm run build:affected:prod:packages --files=${files//\\/\/}
- name: "Prepare nx cache"
shell: "bash"
run: "tar -cf - .nx/cache | lz4 > /tmp/nx_cache.tar.lz4" # compress nx cache
- name: "Preview Release"
shell: "bash"
run: "node ./scripts/publish-preview-release.js"
env:
CHANGED_FILES: "${{ steps.files.outputs.all_changed_files }}"