Skip to content

Commit

Permalink
FIX Use inputs for variables and secrets (#5)
Browse files Browse the repository at this point in the history
Apparently you can't use those contexts directly in a composite action.
  • Loading branch information
GuySartorelli authored Jun 18, 2024
1 parent d4a40ab commit 0120045
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
steps:
- name: Add PR to github project
uses: silverstripe/add-pr-to-project@v1
with:
app_id: ${{ vars.MY_APP_ID }}
private_key: ${{ secrets.MY_PRIVATE_KEY }}
```
This action has no inputs.
12 changes: 10 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Add pull request to project
description: GitHub Action to add new pull requests to the Community Contributions GitHub project

inputs:
app_id:
description: 'The ID for a GitHub App, used to generate a token'
required: true
private_key:
description: 'The private key for a GitHub App, used to generate a token'
required: true

runs:
using: composite
steps:
Expand Down Expand Up @@ -33,8 +41,8 @@ runs:
if: steps.check-if-should-add.outputs.should_add_to_project == 'true' && github.repository_owner == 'silverstripe'
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.PROJECT_PERMISSIONS_APP_ID }}
private-key: ${{ secrets.PROJECT_PERMISSIONS_APP_PRIVATE_KEY }}
app-id: ${{ inputs.app_id }}
private-key: ${{ inputs.private_key }}

- name: Add to project
if: steps.check-if-should-add.outputs.should_add_to_project == 'true'
Expand Down

0 comments on commit 0120045

Please sign in to comment.