Skip to content

Commit

Permalink
Add Dropbox action
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyroddy committed Oct 27, 2023
1 parent 497169f commit a73187e
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
15 changes: 15 additions & 0 deletions actions/dropbox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Dropbox

This action can be used in the following manner:

```yaml
jobs:
chktex:
runs-on: ubuntu-latest
steps:
- uses: paddyroddy/.github/actions/[email protected]
with:
files-to-upload: "example.pdf"
```
where `x.y.z` is the `major.minor.patch` version of the action.
39 changes: 39 additions & 0 deletions actions/dropbox/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Dropbox
description: Upload files to Dropbox

inputs:
files-to-upload:
description: A list of files to upload to dropbox
required: true

runs:
using: composite
steps:
- name: checkout source
uses: actions/checkout@v4

- name: Set up Dropbox
run: |
echo "CONFIGFILE_VERSION=$CONFIGFILE_VERSION" > ~/.dropbox_uploader
echo "OAUTH_APP_KEY=$OAUTH_APP_KEY" >> ~/.dropbox_uploader
echo "OAUTH_APP_SECRET=$OAUTH_APP_SECRET" >> ~/.dropbox_uploader
echo "OAUTH_REFRESH_TOKEN=$OAUTH_REFRESH_TOKEN" >> ~/.dropbox_uploader
env:
CONFIGFILE_VERSION: ${{secrets.CONFIGFILE_VERSION}}
OAUTH_APP_KEY: ${{secrets.OAUTH_APP_KEY}}
OAUTH_APP_SECRET: ${{secrets.OAUTH_APP_SECRET}}
OAUTH_REFRESH_TOKEN: ${{secrets.OAUTH_REFRESH_TOKEN}}

- name: Retrieve Dropbox uploader script
run: |
curl "https://raw.githubusercontent.com/andreafabrizi/\
Dropbox-Uploader/master/dropbox_uploader.sh" \
-o dropbox_uploader.sh
chmod +x dropbox_uploader.sh
- name: Upload PDF
run: |
for file in ${{ inputs.files-to-upload }}; do \
echo $file; \
./dropbox_uploader.sh upload $file $file; \
done

0 comments on commit a73187e

Please sign in to comment.