Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: trunk-io/trunk-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.14
Choose a base ref
...
head repository: trunk-io/trunk-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.1.15
Choose a head ref
  • 3 commits
  • 4 files changed
  • 4 contributors

Commits on May 13, 2024

  1. Upgrade trunk to 1.22.1 (#242)

    [![Trunk](https://static.trunk.io/assets/trunk_action_upgrade_banner.png)](https://trunk.io)
    
    cli upgraded: 1.22.0 → 1.22.1
    
    This PR was generated by the [Trunk Action]. For more info, see our
    [docs] or reach out on [Slack].
    
    [Trunk Action]: https://github.com/trunk-io/trunk-action
    [docs]: https://docs.trunk.io
    [Slack]: https://slack.trunk.io/
    
    Co-authored-by: TylerJang27 <42743566+TylerJang27@users.noreply.github.com>
    trunk-open-pr-bot[bot] and TylerJang27 authored May 13, 2024
    Copy the full SHA
    4a49915 View commit details

Commits on May 14, 2024

  1. Add inputs/outputs to upgrade action (#241)

    Per a user request, adds the following:
    - Input for assignees
    - Input to override the default created branch name
    - Output the PR number and other PR info for consumption from other
    actions
    
    Verified
    [run](https://github.com/trunk-io/trunk-action/actions/runs/9038985803/job/24841100064)
    TylerJang27 authored May 14, 2024
    Copy the full SHA
    d5b1b61 View commit details

Commits on May 16, 2024

  1. fix: attempt to install specified pnpm version (#243)

    Currently, we only install the latest pnpm version, which fails if the
    user has specified a pnpm version under `packageManager` in their
    package.json. This PR changes that to attempt to parse the version out
    of the package.json before defaulting to latest.
    
    The `pnpm/action-setup` action does have logic for parsing the version
    out of the package.json, but we cannot provide both an version and a
    version in the package.json, or it will fail ([source
    link](https://github.com/pnpm/action-setup/blob/master/src/install-pnpm/run.ts#L64)).
    
    Tested manually, both with and without the `packageManager` field.
    puzzler7 authored May 16, 2024
    Copy the full SHA
    f6c5f1b View commit details
Showing with 44 additions and 3 deletions.
  1. +1 −0 .github/workflows/weekly.yaml
  2. +1 −1 .trunk/trunk.yaml
  3. +13 −1 setup-env/action.yaml
  4. +29 −1 upgrade/action.yaml
1 change: 1 addition & 0 deletions .github/workflows/weekly.yaml
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ jobs:
private_key: ${{ secrets.TRUNK_OPEN_PR_APP_PRIVATE_KEY }}

- name: Trunk Upgrade
id: upgrade
uses: ./upgrade # external users: use trunk-io/trunk-action/upgrade@v1
with:
github-token: ${{ steps.generate-token.outputs.token }}
2 changes: 1 addition & 1 deletion .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 0.1

cli:
version: 1.22.0
version: 1.22.1

plugins:
sources:
14 changes: 13 additions & 1 deletion setup-env/action.yaml
Original file line number Diff line number Diff line change
@@ -71,11 +71,23 @@ runs:
echo "Could not find existing node install, skipping node package installation"
fi
- name: Determine pnpm version
if: env.PACKAGE_MANAGER == 'pnpm'
shell: bash
run: |
if [ -e package.json ] && command -v jq >/dev/null; then
PNPM_VERSION=$(jq -r '.packageManager|split("@")[1]' package.json || echo "")
fi
if [ -z "${PNPM_VERSION}" ]; then
PNPM_VERSION=latest
fi
echo "PNPM_VERSION=${PNPM_VERSION}" >>$GITHUB_ENV
- name: Install pnpm
if: env.PACKAGE_MANAGER == 'pnpm'
uses: pnpm/action-setup@v2
with:
version: latest
version: ${{ env.PNPM_VERSION }}

- name: Install Node dependencies
id: setup_node
30 changes: 29 additions & 1 deletion upgrade/action.yaml
Original file line number Diff line number Diff line change
@@ -43,6 +43,15 @@ inputs:
required: false
default: "false"

branch-name:
description: The branch name to generate the PR from
default: trunk-io/update-trunk
required: false

assignees:
description: A comma or newline separated list of GitHub assignee usernames
required: false

reviewers:
description: A comma or newline separated list of GitHub reviewer usernames
required: false
@@ -61,6 +70,23 @@ inputs:
description: A boolean to add a Signed-off-by line to the commit message
required: false
default: false
outputs:
pull-request-number:
description: The pull request number
value: ${{ steps.cpr.outputs.pull-request-number }}

pull-request-url:
description: The URL of the pull request.
value: ${{ steps.cpr.outputs.pull-request-url }}

pull-request-operation:
description:
The pull request operation performed by the action, `created`, `updated` or `closed`.
value: ${{ steps.cpr.outputs.pull-request-operation }}

pull-request-head-sha:
description: The commit SHA of the pull request branch.
value: ${{ steps.cpr.outputs.pull-request-head-sha }}

runs:
using: composite
@@ -115,16 +141,18 @@ runs:
${{ github.action_path }}/../cleanup.sh
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
title: ${{ inputs.prefix }}${{ env.PR_TITLE }}
body: ${{ env.PR_DESCRIPTION }}
base: ${{ inputs.base }}
branch: trunk-io/update-trunk
branch: ${{ inputs.branch-name }}
labels: trunk
add-paths: ${{ inputs.add-paths }}
commit-message: ${{ inputs.prefix }}${{ env.PR_TITLE }}
delete-branch: true
assignees: ${{ inputs.assignees }}
reviewers: ${{ inputs.reviewers }}
token: ${{ inputs.github-token }}
signoff: ${{ inputs.signoff }}