chore(deps): bump js-yaml from 4.1.0 to 4.1.1 #695
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: CI/CD | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| release: | |
| types: [created, published, edited] | |
| push: | |
| branches: | |
| - master | |
| - "releases/*" | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 | |
| with: | |
| node-version-file: .node-version | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --ignore-scripts | |
| - name: Check version consistency | |
| run: | | |
| set +e # We want to handle errors ourselves to provide better messages | |
| PACKAGE_VERSION=$(jq -r ' | |
| .version | | |
| if test("^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-Za-z.-]+)?(\\+[0-9A-Za-z.-]+)?$") | |
| then . | |
| else error("Invalid semver format in package.json") | |
| end | |
| ' package.json 2>&1) | |
| JQ_EXIT_CODE=$? | |
| if [ $JQ_EXIT_CODE -ne 0 ]; then | |
| echo "::error::Invalid semver version in package.json" | |
| exit 2 | |
| fi | |
| ACTION_TAG=$(grep 'image: docker://ghcr.io' action.yml | sed 's/.*://g' | grep -Eo '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$') | |
| GREP_EXIT_CODE=$? | |
| set -e # Re-enable exit on error | |
| if [ $GREP_EXIT_CODE -ne 0 ] || [ -z "$ACTION_TAG" ]; then | |
| echo "::error::Invalid or missing version format in action.yml" | |
| exit 3 | |
| fi | |
| if [ "$PACKAGE_VERSION" != "$ACTION_TAG" ]; then | |
| echo "::error::Version mismatch! package.json has $PACKAGE_VERSION but action.yml has $ACTION_TAG" | |
| exit 4 | |
| fi | |
| echo "✅ Versions match: $PACKAGE_VERSION" | |
| - name: Run knip | |
| run: pnpm run knip | |
| ci: | |
| name: Integration | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 | |
| with: | |
| node-version-file: .node-version | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --ignore-scripts | |
| - name: Run integration tests | |
| run: pnpm run test | |
| cd: | |
| name: Deployment | |
| # Only run for push events (master, releases) and releases | |
| if: github.event_name != 'pull_request' | |
| needs: [ci, lint] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Get Git SHA | |
| id: sha | |
| run: echo "sha=${{ github.sha }}" >> $GITHUB_OUTPUT | |
| - name: Get Docker tag | |
| id: docker-tag | |
| run: | | |
| ref="${{ github.ref_name }}" | |
| tag=$( \ | |
| echo "$ref" \ | |
| | sed 's#refs/heads/##g' \ | |
| | sed 's#refs/tags/##g' \ | |
| | tr '/' '_' \ | |
| | tr -d '#' \ | |
| ) | |
| if [ "$tag" == "master" ]; then | |
| tag="latest" | |
| fi | |
| echo "tag=$tag" >> $GITHUB_OUTPUT | |
| - id: package | |
| run: | | |
| VERSION=$(jq -r ' | |
| .version | | |
| if test("^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-ZaZ.-]+)?(\\+[0-9A-ZaZ.-]+)?$") | |
| then . | |
| else error("Invalid semver format in package.json") | |
| end | |
| ' package.json 2>&1) | |
| if [ $? -ne 0 ]; then | |
| echo "::error::$VERSION" # Expand the error into an annotation | |
| exit 1 | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Collect Docker labels & tags | |
| id: docker-labels-tags | |
| run: | | |
| echo 'labels<<__LABELS_EOF__' >> $GITHUB_OUTPUT | |
| echo "org.opencontainers.image.title=47ng/actions-clever-cloud" >> $GITHUB_OUTPUT | |
| echo "org.opencontainers.image.description=GitHub action to deploy to Clever Cloud" >> $GITHUB_OUTPUT | |
| echo "org.opencontainers.image.version=${{ steps.package.outputs.version }}" >> $GITHUB_OUTPUT | |
| echo "org.opencontainers.image.revision=${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT | |
| echo "org.opencontainers.image.licenses=MIT" >> $GITHUB_OUTPUT | |
| echo "org.opencontainers.image.source=https://github.com/${{github.repository}}/tree/${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT | |
| echo "org.opencontainers.image.documentation=https://github.com/${{github.repository}}/blob/master/packages/server/README.md" >> $GITHUB_OUTPUT | |
| echo "org.opencontainers.image.url=https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" >> $GITHUB_OUTPUT | |
| echo '__LABELS_EOF__' >> $GITHUB_OUTPUT | |
| echo 'tags<<__TAGS_EOF__' >> $GITHUB_OUTPUT | |
| if [ "${{ github.ref_name }}" == "master" ]; then | |
| echo "ghcr.io/47ng/actions-clever-cloud:${{ steps.package.outputs.version }}" >> $GITHUB_OUTPUT | |
| echo "47ng/actions-clever-cloud:${{ steps.package.outputs.version }}" >> $GITHUB_OUTPUT | |
| fi | |
| echo "ghcr.io/47ng/actions-clever-cloud:${{ steps.docker-tag.outputs.tag }}" >> $GITHUB_OUTPUT | |
| echo "ghcr.io/47ng/actions-clever-cloud:git-${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT | |
| echo "47ng/actions-clever-cloud:${{ steps.docker-tag.outputs.tag }}" >> $GITHUB_OUTPUT | |
| echo "47ng/actions-clever-cloud:git-${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT | |
| echo '__TAGS_EOF__' >> $GITHUB_OUTPUT | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USER }} | |
| password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| id: docker-build-push | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| with: | |
| context: . | |
| labels: "${{ steps.docker-labels-tags.outputs.labels }}" | |
| tags: "${{ steps.docker-labels-tags.outputs.tags }}" | |
| push: true | |
| - name: Generate step summary | |
| run: | | |
| echo "## 🐳 Docker image" >> $GITHUB_STEP_SUMMARY | |
| echo "Digest: \`${{ steps.docker-build-push.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY | |
| echo "### 📌 Tags" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| echo "${{ steps.docker-labels-tags.outputs.tags }}" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| echo "### 🏷 Labels" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| echo "${{ steps.docker-labels-tags.outputs.labels }}" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY |