Skip to content

Commit

Permalink
Copy and restore DESCRIPTION (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
walkowif authored Sep 26, 2024
1 parent 98df9df commit 63b24d1
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ inputs:
Comma-separated list of pkgcache-compatible repository names from which the dependencies will be downloaded.
required: false
default: "PPM@latest"
restore-description:
description: |
Whether the DESCRIPTION file (modified by this action) should be restored to its original contents?
required: false
default: true

branding:
icon: 'download'
Expand All @@ -79,6 +84,17 @@ runs:
fi
shell: bash

- name: Copy DESCRIPTION
if: ${{ inputs.restore-description == 'true' }}
run: |
echo "::group::Copy DESCRIPTION"
temp_desc=$(mktemp)
cp ${{ inputs.repository-path }}/DESCRIPTION $temp_desc
echo "TEMP_DESCRIPTION=$temp_desc" >> $GITHUB_ENV
ls -l $temp_desc
echo "::endgroup::"
shell: bash

- name: Install required packages
uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand Down Expand Up @@ -372,3 +388,12 @@ runs:
DepsBranch
DepsDev
dependencies: ${{ inputs.dependencies }}

- name: Restore DESCRIPTION
if: ${{ inputs.restore-description == 'true' }}
run: |
echo "::group::Restore DESCRIPTION"
cp ${{ env.TEMP_DESCRIPTION }} ${{ inputs.repository-path }}/DESCRIPTION
ls -l ${{ inputs.repository-path }}/DESCRIPTION
echo "::endgroup::"
shell: bash

0 comments on commit 63b24d1

Please sign in to comment.