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.11
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.12
Choose a head ref
  • 2 commits
  • 3 files changed
  • 3 contributors

Commits on Mar 25, 2024

  1. Upgrade trunk (#235)

    [![Trunk](https://static.trunk.io/assets/trunk_action_upgrade_banner.png)](https://trunk.io)
    
    1 plugin was upgraded:
    
    - trunk-io/plugins v1.4.4 → v1.4.5
    
    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 Mar 25, 2024
    Copy the full SHA
    4feb07f View commit details
  2. add install action to install all trunk tools in trunk.yaml (#234)

    install will pull trunk launcher from cloud into tmp location and then
    run the `trunk tools install` command.
    
    Optionally installs that are specified - else installs everything.
    
    Example of using it in flaky factory
    
    
    https://github.com/trunk-io/flake-factory/blob/main/.github/workflows/factory.yaml
    
          - name: trunk install
    uses:
    54ccfcf
    EliSchleifer authored Mar 25, 2024
    Copy the full SHA
    540e7fe View commit details
Showing with 56 additions and 1 deletion.
  1. +1 −1 .trunk/trunk.yaml
  2. +35 −0 install/action.yaml
  3. +20 −0 install/get_trunk.sh
2 changes: 1 addition & 1 deletion .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ cli:
plugins:
sources:
- id: trunk
ref: v1.4.4
ref: v1.4.5
uri: https://github.com/trunk-io/plugins
- id: configs
ref: v1.0.4
35 changes: 35 additions & 0 deletions install/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Trunk Check
author: trunk.io
description: Install trunk and managed tools to PATH

inputs:
tools:
description: specific tools to install (if not specified will install all enabled tools)
required: false

branding:
icon: check
color: green

runs:
using: composite
steps:
- name: get trunk
shell: bash
run: ${GITHUB_ACTION_PATH}/get_trunk.sh

- name: clean up possible dead symlink
shell: bash
run: |
tools_path=".trunk/tools"
if [ -L "${tools_path}" ] && [ ! -e "${tools_path}" ] ; then
rm "${tools_path}"
fi
- name: Trunk install
shell: bash
run: trunk tools install --ci ${{ inputs.tools }}

- name: Add .trunk/tools to path
shell: bash
run: echo ".trunk/tools" >> $GITHUB_PATH
20 changes: 20 additions & 0 deletions install/get_trunk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -euo pipefail

if [[ ${INPUT_DEBUG:-false} == "true" ]]; then
set -x
fi

tmpdir="$(mktemp -d)"
echo "TRUNK_TMPDIR=${tmpdir}" >>"${GITHUB_ENV}"

curl -fsSL https://trunk.io/releases/trunk -o "${tmpdir}/trunk"
chmod u+x "${tmpdir}/trunk"
trunk_path="${tmpdir}/trunk"

echo "TRUNK_PATH=${trunk_path}" >>"${GITHUB_ENV}"
echo "${tmpdir}" >>"${GITHUB_PATH}"

# Ensure that trunk CLI is downloaded before subsequent steps (swallow output of version command)
(${trunk_path} version >/dev/null 2>&1) || echo "::warning::${trunk_path} does not exist!"