diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d7c6a4b..d2a4b19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,12 +4,18 @@ name: "Build" on: workflow_call: +defaults: + run: + working-directory: "pulp-cli-gem" + jobs: build: runs-on: "ubuntu-latest" steps: - name: "Checkout" uses: "actions/checkout@v6" + with: + path: "pulp-cli-gem" - name: "Set up Python" uses: "actions/setup-python@v6" with: @@ -28,8 +34,8 @@ jobs: with: name: "pulp_cli_packages" path: | - .root - dist/ + pulp-cli-gem/.root + pulp-cli-gem/dist/ if-no-files-found: "error" retention-days: 5 ... diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index facb1a8..f6d9cee 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -7,6 +7,10 @@ on: - "main" workflow_call: +defaults: + run: + working-directory: "pulp-cli-gem" + jobs: analyze: name: "Analyze" @@ -19,6 +23,8 @@ jobs: steps: - name: "Checkout" uses: "actions/checkout@v6" + with: + path: "pulp-cli-gem" - name: "Initialize CodeQL" uses: "github/codeql-action/init@v4" with: diff --git a/.github/workflows/collect_changes.yml b/.github/workflows/collect_changes.yml index 5e08242..d615e12 100644 --- a/.github/workflows/collect_changes.yml +++ b/.github/workflows/collect_changes.yml @@ -4,6 +4,10 @@ on: workflow_call: workflow_dispatch: +defaults: + run: + working-directory: "pulp-cli-gem" + jobs: collect-changes: runs-on: "ubuntu-latest" @@ -11,6 +15,7 @@ jobs: - name: "Checkout" uses: "actions/checkout@v6" with: + path: "pulp-cli-gem" fetch-depth: 0 - name: "Set up Python" uses: "actions/setup-python@v6" @@ -31,17 +36,23 @@ jobs: - name: "Create Pull Request" uses: "peter-evans/create-pull-request@v8" id: "create_pr" + permissions: + contents: "write" + pull-requests: "write" with: - token: "${{ secrets.RELEASE_TOKEN }}" title: "Update Changelog" body: "" branch: "update_changes" delete-branch: true + path: "pulp-cli-gem" - name: "Mark PR automerge" + permissions: + contents: "write" + pull-requests: "write" run: | gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}" if: "steps.create_pr.outputs.pull-request-number" env: - GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}" + GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" continue-on-error: true ... diff --git a/.github/workflows/cookiecutter.yml b/.github/workflows/cookiecutter.yml index 09995d4..cd99dd2 100644 --- a/.github/workflows/cookiecutter.yml +++ b/.github/workflows/cookiecutter.yml @@ -17,9 +17,9 @@ jobs: with: repository: "pulp/pulp-cli" path: "pulp-cli" - - uses: "actions/checkout@v6" + - name: "Checkout" + uses: "actions/checkout@v6" with: - token: "${{ secrets.RELEASE_TOKEN }}" path: "pulp-cli-gem" - name: "Set up Python" uses: "actions/setup-python@v6" @@ -45,19 +45,24 @@ jobs: - name: "Create Pull Request" uses: "peter-evans/create-pull-request@v8" id: "create_pr" + permissions: + contents: "write" + pull-requests: "write" with: - token: "${{ secrets.RELEASE_TOKEN }}" title: "Update cookiecutter" body: "" branch: "update_cookiecutter" delete-branch: true path: "pulp-cli-gem" - name: "Mark PR automerge" + permissions: + contents: "write" + pull-requests: "write" run: | gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}" if: "steps.create_pr.outputs.pull-request-number" env: - GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}" + GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" continue-on-error: true update-dependencies: runs-on: "ubuntu-latest" @@ -68,7 +73,6 @@ jobs: path: "pulp-cli" - uses: "actions/checkout@v6" with: - token: "${{ secrets.RELEASE_TOKEN }}" path: "pulp-cli-gem" - name: "Set up Python" uses: "actions/setup-python@v6" @@ -94,18 +98,23 @@ jobs: - name: "Create Pull Request" uses: "peter-evans/create-pull-request@v8" id: "create_pr" + permissions: + contents: "write" + pull-requests: "write" with: - token: "${{ secrets.RELEASE_TOKEN }}" title: "Update CLI and GLUE" body: "" branch: "update_cli" delete-branch: true path: "pulp-cli-gem" - name: "Mark PR automerge" + permissions: + contents: "write" + pull-requests: "write" run: | gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}" if: "steps.create_pr.outputs.pull-request-number" env: - GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}" + GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" continue-on-error: true ... diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fee95cd..4d9cc40 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,6 +4,10 @@ name: "Lint" on: workflow_call: +defaults: + run: + working-directory: "pulp-cli-gem" + jobs: lint: runs-on: "ubuntu-latest" @@ -16,6 +20,8 @@ jobs: steps: - name: "Checkout" uses: "actions/checkout@v6" + with: + path: "pulp-cli-gem" - name: "Set up Python" uses: "actions/setup-python@v6" with: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5617875..f883856 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -29,6 +29,7 @@ jobs: - name: "Checkout" uses: "actions/checkout@v6" with: + path: "pulp-cli-gem" fetch-depth: 0 - name: "Set up Python" uses: "actions/setup-python@v6" @@ -53,6 +54,7 @@ jobs: fi done shell: "bash" + working-directory: "pulp-cli-gem" ready-to-ship: # This is a dummy dependent task to have a single entry for the branch protection rules. runs-on: "ubuntu-latest" diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/pr_checks.yml index c031756..5901490 100644 --- a/.github/workflows/pr_checks.yml +++ b/.github/workflows/pr_checks.yml @@ -12,16 +12,19 @@ concurrency: group: "${{ github.event.pull_request.number }}-${{ github.workflow }}" cancel-in-progress: true +defaults: + run: + working-directory: "pulp-cli-gem" + jobs: apply_labels: runs-on: "ubuntu-latest" name: "Label PR" - permissions: - pull-requests: "write" steps: - name: "Checkout" uses: "actions/checkout@v6" with: + path: "pulp-cli-gem" fetch-depth: 0 - name: "Set up Python" uses: "actions/setup-python@v6" @@ -38,6 +41,8 @@ jobs: uv run -q .ci/scripts/pr_labels.py "origin/${{ github.base_ref }}" "${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV" - name: "Apply PR Labels" uses: "actions/github-script@v8" + permissions: + pull-requests: "write" with: script: | const { ADD_LABELS, REMOVE_LABELS } = process.env; diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bda5708..cc6b130 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,14 +4,19 @@ name: "pulp-cli Release" on: workflow_dispatch: +defaults: + run: + working-directory: "pulp-cli-gem" + jobs: release: name: "Release" runs-on: "ubuntu-latest" steps: - - uses: "actions/checkout@v6" + - name: "Checkout" + uses: "actions/checkout@v6" with: - token: "${{ secrets.RELEASE_TOKEN }}" + path: "pulp-cli-gem" - name: "Set up Python" uses: "actions/setup-python@v6" with: @@ -26,6 +31,8 @@ jobs: git config user.name pulpbot git config user.email pulp-infra@redhat.com - name: "Release" + permissions: + contents: "write" run: | uv run --with bump-my-version~=0.20.0 --with towncrier~=23.11.0 .ci/scripts/release.sh ... diff --git a/.github/workflows/release_branch.yml b/.github/workflows/release_branch.yml index f20a5ef..62db424 100644 --- a/.github/workflows/release_branch.yml +++ b/.github/workflows/release_branch.yml @@ -3,13 +3,18 @@ name: "Create Release Branch" on: workflow_dispatch: +defaults: + run: + working-directory: "pulp-cli-gem" + jobs: create-release-branch: runs-on: "ubuntu-latest" steps: - - uses: "actions/checkout@v6" + - name: "Checkout" + uses: "actions/checkout@v6" with: - token: "${{ secrets.RELEASE_TOKEN }}" + path: "pulp-cli-gem" - name: "Set up Python" uses: "actions/setup-python@v6" with: @@ -24,26 +29,36 @@ jobs: git config user.name pulpbot git config user.email pulp-infra@redhat.com - name: "Create Release Branch" + permissions: + contents: "write" run: | uv run --with bump-my-version~=0.20.0 .ci/scripts/create_release_branch.sh - name: "Create Pull Request" uses: "peter-evans/create-pull-request@v8" id: "create_pr" + permissions: + contents: "write" + pull-requests: "write" with: - token: "${{ secrets.RELEASE_TOKEN }}" title: "Bump dev-version" body: "" branch: "bump_version" delete-branch: true + path: "pulp-cli-gem" - name: "Mark PR automerge" + permissions: + contents: "write" + pull-requests: "write" run: | gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}" if: "steps.create_pr.outputs.pull-request-number" env: - GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}" + GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" continue-on-error: true - name: "Add Backport Label for new Branch" uses: "actions/github-script@v8" + permissions: + issues: "write" with: script: | const { NEW_BRANCH } = process.env; diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 65c5b65..12baddf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,6 +4,10 @@ name: "Test" on: workflow_call: +defaults: + run: + working-directory: "pulp-cli-gem" + env: COLORTERM: "yes" TERM: "xterm-256color" @@ -28,6 +32,8 @@ jobs: steps: - name: "Checkout" uses: "actions/checkout@v6" + with: + path: "pulp-cli-gem" - name: "Download wheels" uses: "actions/download-artifact@v8" with: @@ -64,5 +70,5 @@ jobs: RESOLUTION=() fi - uv run "${RESOLUTION[@]}" --isolated --with dist/pulp_glue*.whl --with dist/pulp_cli*.whl --only-group test .ci/run_container.sh make _test + uv run "${RESOLUTION[@]}" --isolated --with ../dist/pulp_glue*.whl --with ../dist/pulp_cli*.whl --only-group test .ci/run_container.sh make _test ... diff --git a/Makefile b/Makefile index 459ca6c..46a133a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ +# This file is managed by the cookiecutter templates. +# Do not edit manually GLUE_PLUGINS=$(notdir $(wildcard pulp-glue-gem/src/pulp_glue/*)) CLI_PLUGINS=$(notdir $(wildcard src/pulpcore/cli/*))