Skip to content

Commit

Permalink
Improved outdated (#2)
Browse files Browse the repository at this point in the history
* Improved outdated check

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* Comment

* debug

* debug

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks

* fix linebreaks
  • Loading branch information
jvdlaar authored May 26, 2021
1 parent 9473090 commit 3bc652a
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,22 @@ outputs:
runs:
using: "composite"
steps:
- name: Install outdated tool
shell: bash
run: |
yarn global add check-outdated --preferred-cache-folder ${{ inputs.yarn-cache }}
echo "$(yarn global bin)" >> $GITHUB_PATH
- name: Install dependencies
shell: bash
run: yarn install --no-progress --preferred-cache-folder ${{ inputs.yarn-cache }} --cwd ${{ inputs.working-dir }}

- name: Check pre update outdated
shell: bash
id: get-pre-update-outdated
run: |
set +e
outdated=$( ! yarn outdated --preferred-cache-folder ${{ inputs.yarn-cache }} --cwd ${{ inputs.working-dir }} | sed '1,6d; $d')
outdated="${outdated//$'\n'/'\n'}"
echo "::set-output name=outdated::$outdated"
cd ${{ inputs.working-dir }}
$( ! $(yarn global bin)/check-outdated --depth 1000 --ignore-dev-dependencies --columns name,current,latest,changes > ${{ runner.temp }}/pre-update )
- name: Upgrade dependencies
shell: bash
Expand All @@ -45,15 +49,18 @@ runs:
id: get-post-update-outdated
run: |
set +e
outdated=$( ! yarn outdated --preferred-cache-folder ${{ inputs.yarn-cache }} --cwd ${{ inputs.working-dir }} | sed '1,6d; $d')
outdated="${outdated//$'\n'/'\n'}"
echo "::set-output name=outdated::$outdated"
cd ${{ inputs.working-dir }}
$( ! $(yarn global bin)/check-outdated --depth 1000 --ignore-dev-dependencies --columns name,current,latest,changes > ${{ runner.temp }}/post-update )
echo "::set-output name=outdated::$(cat ${{ runner.temp }}/post-update)"
- name: Make diff
shell: bash
id: get-diff
# strip ansi colors and fix line breaks
run: |
diff=$(comm <(echo "${{ steps.get-pre-update-outdated.outputs.outdated }}") <(echo "${{ steps.get-post-update-outdated.outputs.unformatted-outdated }}") -23)
pre=$(cat ${{ runner.temp }}/pre-update | sed '1,5d' | head -n -6 | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" | sed -r "s/\\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" )
post=$(cat ${{ runner.temp }}/post-update | sed '1,5d' | head -n -6 | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" | sed -r "s/\\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" )
diff=$(comm <(echo "$pre") <(echo "$post") -23)
diff="${diff//'%'/'%25'}"
diff="${diff//$'\n'/'%0A'}"
diff="${diff//$'\r'/'%0D'}"
Expand Down

0 comments on commit 3bc652a

Please sign in to comment.