Skip to content

Commit

Permalink
Fix actions using secrets (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyroddy authored Oct 27, 2023
1 parent 751b3a2 commit bfd17f0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
4 changes: 4 additions & 0 deletions actions/dropbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ jobs:
steps:
- uses: paddyroddy/.github/actions/[email protected]
with:
configfile-version: ${{ secrets.CONFIGFILE_VERSION }}
files-to-upload: example.pdf
oauth-app-key: ${{ secrets.OAUTH_APP_KEY }}
oauth-app-secret: ${{ secrets.OAUTH_APP_SECRET }}
oauth-refresh-token: ${{ secrets.OAUTH_REFRESH_TOKEN }}
```
where `x.y.z` is the `major.minor.patch` version of the action.
24 changes: 20 additions & 4 deletions actions/dropbox/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,26 @@ name: Dropbox
description: Upload files to Dropbox

inputs:
configfile-version:
description: Dropbox app config version
required: true

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

oauth-app-key:
description: Dropbox app OAuth key
required: true

oauth-app-secret:
description: Dropbox app OAuth secret
required: true

oauth-refresh-token:
description: Dropbox app OAuth refresh token
required: true

runs:
using: composite
steps:
Expand All @@ -19,10 +35,10 @@ runs:
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}}
CONFIGFILE_VERSION: ${{inputs.configfile-version }}
OAUTH_APP_KEY: ${{ inputs.oauth-app-key }}
OAUTH_APP_SECRET: ${{ inputs.oauth-app-secret }}
OAUTH_REFRESH_TOKEN: ${{ inputs.oauth-refresh-token }}

- name: Retrieve Dropbox uploader script
run: |
Expand Down
3 changes: 3 additions & 0 deletions actions/latex/vale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: paddyroddy/.github/actions/latex/[email protected]
with:
github-token: ${{ secrets.GITHUB_SECRET }}
```
where `x.y.z` is the `major.minor.patch` version of the action. If flags are
Expand All @@ -20,5 +22,6 @@ jobs:
steps:
- uses: paddyroddy/.github/actions/latex/[email protected]
with:
github-token: ${{ secrets.GITHUB_SECRET }}
vale-flags: ""
```
6 changes: 5 additions & 1 deletion actions/latex/vale/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Vale
description: Runs vale over all TeX files in the repo

inputs:
github-token:
description: GitHub token
required: true

vale-flags:
description: Flags to pass to vale
default: ""
Expand All @@ -15,7 +19,7 @@ runs:
- name: Run Vale
uses: errata-ai/vale-action@v2
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ inputs.github-token }}
with:
fail_on_error: true
filter_mode: nofilter
Expand Down

0 comments on commit bfd17f0

Please sign in to comment.