### Run Unit Tests Source: https://context7.com/cloudfoundry/buildpacks-github-config/llms.txt Executes unit tests using the Ginkgo framework, automatically handling dependency installation and skipping integration-specific test suites. ```bash ./scripts/unit.sh ``` -------------------------------- ### Bootstrap a new buildpack Source: https://github.com/cloudfoundry/buildpacks-github-config/blob/main/README.md Execute the bootstrap script to copy common configuration files into a target buildpack directory. ```bash ./scripts/bootstrap.sh --target ``` -------------------------------- ### Package Buildpack with CLI Source: https://context7.com/cloudfoundry/buildpacks-github-config/llms.txt Use these commands to package buildpacks into zip files with options for caching, stack targeting, and custom output paths. ```bash ./scripts/package.sh --version 1.2.3 --cached ``` ```bash ./scripts/package.sh --version 1.2.3 --stack cflinuxfs4 --output ./dist/my-buildpack.zip ``` ```bash ./scripts/package.sh --help ``` -------------------------------- ### Build CLI Binaries Source: https://context7.com/cloudfoundry/buildpacks-github-config/llms.txt Compiles CLI binaries for multiple operating systems based on the configuration defined in config.json. ```bash ./scripts/build.sh ``` ```json { "oses": ["linux", "darwin", "windows"] } ``` -------------------------------- ### Run Integration Tests Source: https://context7.com/cloudfoundry/buildpacks-github-config/llms.txt Executes integration tests against Cloud Foundry or Docker, supporting parallel execution and cached buildpack configurations. ```bash ./scripts/integration.sh --github-token ghp_xxxxxxxxxxxx ``` ```bash ./scripts/integration.sh --github-token ghp_xxxxxxxxxxxx --platform docker ``` ```bash ./scripts/integration.sh --github-token ghp_xxxxxxxxxxxx --cached true --parallel false ``` ```bash ./scripts/integration.sh --help ``` -------------------------------- ### Bootstrap Buildpack Repository Script Source: https://context7.com/cloudfoundry/buildpacks-github-config/llms.txt Copies shared CI/CD configuration files to a target buildpack repository. Use to set up new buildpack projects with standardized workflows and scripts. ```bash # Bootstrap a new buildpack repository with shared configuration ./scripts/bootstrap.sh --target /path/to/your/buildpack # View usage information ./scripts/bootstrap.sh --help # Example: bootstrapping the nodejs-buildpack ./scripts/bootstrap.sh --target ../nodejs-buildpack # After running, the target directory will contain: # - .github/workflows/*.yml (all workflow files) # - .github/labels.yml (standardized GitHub labels) # - scripts/*.sh (build, test, and packaging scripts) ``` -------------------------------- ### Stack Create Release Action Source: https://context7.com/cloudfoundry/buildpacks-github-config/llms.txt Automates the creation of a BOSH release tarball for a Cloud Foundry stack. Triggered by version tag pushes. ```yaml # Usage in a GitHub Actions workflow for stack releases name: Create Stack Release on: push: tags: - 'v*' jobs: release: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Create BOSH Release uses: cloudfoundry/buildpacks-github-config/actions/stack/create-release@main with: version: "1.0.0" # Release version number release-name: "cflinuxfs4" # Name of the stack release # Output: releases/cflinuxfs4/cflinuxfs4-1.0.0.tgz ``` -------------------------------- ### Package Buildpack Script Source: https://context7.com/cloudfoundry/buildpacks-github-config/llms.txt Packages a buildpack into a distributable .zip file using the buildpack-packager tool. Supports specifying a version number for the package. ```bash # Package a buildpack with a specific version ./scripts/package.sh --version 1.2.3 ``` -------------------------------- ### Dependency Deprecation List Action Source: https://context7.com/cloudfoundry/buildpacks-github-config/llms.txt Parses buildpack dependency deprecation metadata to generate a markdown list of upcoming deprecations. Requires checkout and uses a bot token for filing issues. ```yaml # Usage in a GitHub Actions workflow (.github/workflows/dependency-deprecation-reminder.yml) name: Dependency Deprecation Reminder on: schedule: - cron: '5 0 * * 0' # Run weekly on Sundays workflow_dispatch: {} jobs: reminder: name: Reminder runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 with: ref: master - name: Get deprecations id: deprecations uses: cloudfoundry/buildpacks-github-config/actions/dependency/deprecation-list@main with: buildpack: . # Path to buildpack root buffer-days: 10 # Alert for deps expiring in 10 days # reference-date: "2024-01-15" # Optional: use specific date instead of today - name: File Issue if: steps.deprecations.outputs.list != '' uses: paketo-buildpacks/github-config/actions/issue/file@main with: token: ${{ secrets.CF_BOT_GITHUB_TOKEN }} repo: ${{ github.repository }} label: dependency-deprecation issue_title: Dependency Deprecation Alert issue_body: | Please make sure the following dependencies are removed on time. ${{ steps.deprecations.outputs.list }} ``` -------------------------------- ### Stack Add Upload Blobs Action Source: https://context7.com/cloudfoundry/buildpacks-github-config/llms.txt Adds rootfs blobs to the BOSH release blobstore and uploads them to AWS S3. Requires AWS credentials and specifies blob patterns. ```yaml # Usage in a GitHub Actions workflow for stack releases name: Upload Stack Blobs on: workflow_dispatch: inputs: version: description: 'Release version' required: true jobs: upload: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Add and Upload Blobs uses: cloudfoundry/buildpacks-github-config/actions/stack/add-upload-blobs@main with: version: ${{ github.event.inputs.version }} access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} release-name: "cflinuxfs4" blob-glob: "cflinuxfs4-*.tar.gz" # Pattern to find blob file blob-name: "rootfs" # Blob path in blobstore ``` -------------------------------- ### Synchronize Labels GitHub Action Workflow Source: https://context7.com/cloudfoundry/buildpacks-github-config/llms.txt Synchronizes repository labels based on a configuration file when changes are pushed to the master branch. ```yaml name: Synchronize Labels on: push: branches: - master paths: - .github/labels.yml workflow_dispatch: {} jobs: synchronize: name: Synchronize Labels runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: micnncim/action-label-syncer@v1 env: GITHUB_TOKEN: ${{ github.token }} ``` -------------------------------- ### Update GitHub Config Workflow Source: https://context7.com/cloudfoundry/buildpacks-github-config/llms.txt A GitHub Actions workflow that synchronizes shared configuration files from a central repository to individual buildpack repositories via automated pull requests. ```yaml name: Update shared github-config on: schedule: - cron: '10 9 * * *' # Daily at 9:10 AM UTC workflow_dispatch: { } jobs: build: name: Create PR to update shared files runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: token: ${{ secrets.CF_BOT_GITHUB_TOKEN }} ref: master - name: Checkout github-config uses: actions/checkout@v4 with: repository: cloudfoundry/buildpacks-github-config path: github-config - name: Checkout Branch uses: paketo-buildpacks/github-config/actions/pull-request/checkout-branch@main with: branch: automation/github-config/update - name: Run the sync action uses: paketo-buildpacks/github-config/actions/sync@main with: workspace: /github/workspace config: /github/workspace/github-config/buildpack - name: Open Pull Request uses: paketo-buildpacks/github-config/actions/pull-request/open@main with: token: ${{ secrets.CF_BOT_GITHUB_TOKEN }} title: "Updates github-config" branch: automation/github-config/update base: master ``` -------------------------------- ### Auto-Merge GitHub Action Workflow Source: https://context7.com/cloudfoundry/buildpacks-github-config/llms.txt Automates the merging of pull requests triggered by specific bots when the mergeable state is clean. ```yaml name: Auto-Merge on: repository_dispatch: types: - approve-bot-pr jobs: automerge: name: Merge or Rebase if: ${{ github.event.client_payload.login == 'cf-buildpacks-eng' || github.event.client_payload.login == 'dependabot[bot]' }} runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Fetch Pull Request Details id: pull_request env: NUMBER: ${{ github.event.client_payload.number }} GITHUB_TOKEN: ${{ secrets.CF_BOT_GITHUB_TOKEN }} run: | payload="$(curl "https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${NUMBER}" \ --silent --location --header "Authorization: token ${GITHUB_TOKEN}")" echo "mergeable_state=$(echo "${payload}" | jq -r .mergeable_state)" >> $GITHUB_OUTPUT - name: Merge if: ${{ steps.pull_request.outputs.mergeable_state == 'clean' }} uses: paketo-buildpacks/github-config/actions/pull-request/merge@main with: token: ${{ secrets.CF_BOT_GITHUB_TOKEN }} number: ${{ github.event.client_payload.number }} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.