Skip to content

Commit

Permalink
Upload regenerated yarn.lock on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
lzm0 committed Mar 12, 2024
1 parent 1f80851 commit 846f8f4
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions yarn/action.yml
Expand Up @@ -204,15 +204,24 @@ runs:
if: ${{ failure() && steps.install-dependencies.conclusion == 'failure' }}
shell: bash
env:
CI: 0
run: yarn install
YARN_CHECKSUM_BEHAVIOR: update
run: |
yarn install
(
echo '# Bad `yarn.lock`'
echo '## Bad local cache'
echo 'This could be caused by bad locally cached packages.'
echo 'Try running: [`yarn cache clean --all`](https://yarnpkg.com/cli/cache/clean#options)'
echo '## Generated `yarn.lock` file'
echo 'You can retrieve the `yarn.lock` file from artifacts (above)'
) >> "$GITHUB_STEP_SUMMARY"
working-directory: ${{ inputs.working-directory }}

- name: Upload yarn.lock on failure
- name: Upload regenerated yarn.lock on failure
if: ${{ failure() && steps.install-dependencies.conclusion == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: yarn-lock-${{ inputs.working-directory }}
name: ${{ inputs.working-directory != '.' && format('{0}-', inputs.working-directory) || '' }}yarn.lock
path: ${{ inputs.working-directory }}/yarn.lock

- name: Build
Expand Down

0 comments on commit 846f8f4

Please sign in to comment.