From fea7ec29a57100bb3a58639ffcf06e2b47671042 Mon Sep 17 00:00:00 2001 From: ivegabr Date: Fri, 10 Jan 2025 17:04:14 +0100 Subject: [PATCH] fix indentation --- .github/workflows/publish_npm.yml | 120 +++++++++++++++--------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/.github/workflows/publish_npm.yml b/.github/workflows/publish_npm.yml index 7c085fe..85e05d4 100644 --- a/.github/workflows/publish_npm.yml +++ b/.github/workflows/publish_npm.yml @@ -8,72 +8,72 @@ on: permissions: read-all jobs: - publish: - runs-on: ubuntu-latest + publish: + runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: "Check file existence" - id: check_files - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: "package.json, README.md" - - - name: File exists - if: steps.check_files.outputs.files_exists != 'true' - # Only runs if all of the files exists - run: exit 1 + - name: "Check file existence" + id: check_files + uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 + with: + files: "package.json, README.md" + + - name: File exists + if: steps.check_files.outputs.files_exists != 'true' + # Only runs if all of the files exists + run: exit 1 - - name: Get package.json package name and match with repository name - run: | - echo PACKAGE_NAME=$(cat package.json | jq .name | cut -f2 -d"\"" | cut -f2 -d"@") >> $GITHUB_OUTPUT - echo PACKAGE_VERSION="refs/tags/v"$(cat package.json | jq .version | cut -f2 -d"\"") >> $GITHUB_OUTPUT - echo PACKAGE_REPOSITORY=$(cat package.json | jq .repository | cut -f2 -d"\"" | sed 's/:/\//' | sed 's/@/:\/\//') >> $GITHUB_OUTPUT - id: get_package_info + - name: Get package.json package name and match with repository name + run: | + echo PACKAGE_NAME=$(cat package.json | jq .name | cut -f2 -d"\"" | cut -f2 -d"@") >> $GITHUB_OUTPUT + echo PACKAGE_VERSION="refs/tags/v"$(cat package.json | jq .version | cut -f2 -d"\"") >> $GITHUB_OUTPUT + echo PACKAGE_REPOSITORY=$(cat package.json | jq .repository | cut -f2 -d"\"" | sed 's/:/\//' | sed 's/@/:\/\//') >> $GITHUB_OUTPUT + id: get_package_info - - name: Check if package_name matches with repository name - if: github.repository != steps.get_package_info.outputs.PACKAGE_NAME - # Fail if package name not properly configured - run: exit 1 + - name: Check if package_name matches with repository name + if: github.repository != steps.get_package_info.outputs.PACKAGE_NAME + # Fail if package name not properly configured + run: exit 1 - - name: Check if package version matches with tag - if: github.ref != steps.get_package_info.outputs.PACKAGE_VERSION - # Fail if package version not properly setted - run: exit 1 - - - name: Check if package repository matches with repository - if: github.repositoryUrl != steps.get_package_info.outputs.PACKAGE_REPOSITORY - # Fail if package repository doesn't match with repository - run: exit 1 + - name: Check if package version matches with tag + if: github.ref != steps.get_package_info.outputs.PACKAGE_VERSION + # Fail if package version not properly setted + run: exit 1 + + - name: Check if package repository matches with repository + if: github.repositoryUrl != steps.get_package_info.outputs.PACKAGE_REPOSITORY + # Fail if package repository doesn't match with repository + run: exit 1 - - name: Setup Node.js - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0 - with: - node-version: 18 + - name: Setup Node.js + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0 + with: + node-version: 18 - - name: Install dependencies - run: npm install + - name: Install dependencies + run: npm install - - name: Pre upload validation - id: pack - run: | - npm pack --dry-run >> output 2>&1 - echo PRE_UPLOAD_HASH=$(cat output| grep shasum | cut -f4 -d" ") >> $GITHUB_OUTPUT - - - name: Upload package - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - - name: Post upload validation - id: unpack - run: | - PACKAGE_NAME=$(cat package.json | jq .name | cut -f2 -d"\"")@$(cat package.json | jq .version | cut -f2 -d"\"") - echo POST_UPLOAD_HASH=$(npm view $PACKAGE_NAME) >> $GITHUB_OUTPUT + - name: Pre upload validation + id: pack + run: | + npm pack --dry-run >> output 2>&1 + echo PRE_UPLOAD_HASH=$(cat output| grep shasum | cut -f4 -d" ") >> $GITHUB_OUTPUT + + - name: Upload package + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + - name: Post upload validation + id: unpack + run: | + PACKAGE_NAME=$(cat package.json | jq .name | cut -f2 -d"\"")@$(cat package.json | jq .version | cut -f2 -d"\"") + echo POST_UPLOAD_HASH=$(npm view $PACKAGE_NAME) >> $GITHUB_OUTPUT - - name: Pre and Post Upload validation - if: steps.pack.outputs.PRE_UPLOAD_HASH != steps.unpack.outputs.POST_UPLOAD_HASH - # Fail if package hashes doesn't match - run: exit 1 \ No newline at end of file + - name: Pre and Post Upload validation + if: steps.pack.outputs.PRE_UPLOAD_HASH != steps.unpack.outputs.POST_UPLOAD_HASH + # Fail if package hashes doesn't match + run: exit 1 \ No newline at end of file