-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding support for getting a token if the application is installed on an organization * Adding more workflow tests for organization applications * Adding better tracking on execution when retrieving the token due to two major execution paths * Updating dependencies
- Loading branch information
1 parent
4a38172
commit 33bc2a1
Showing
12 changed files
with
1,662 additions
and
147 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
.github/workflows/test_failure_organization_not_installed.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Tests this action failure by the application not being installed on the organization | ||
|
||
name: Test Failure - organization - not installed | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test_failure: | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
|
||
outputs: | ||
action_step_outcome: ${{ steps.use_action.outcome }} | ||
action_step_conclusion: ${{ steps.use_action.conclusion }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use action | ||
id: use_action | ||
uses: ./ | ||
with: | ||
application_id: ${{ secrets.APPLICATION_ID_NOT_INSTALLED }} | ||
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY_NOT_INSTALLED }} | ||
organization: devopsventures | ||
|
||
validate_results: | ||
needs: test_failure | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Validate failure | ||
if: needs.test_failure.outputs.action_step_outcome != 'failure' | ||
run: | | ||
echo "Outcome: ${{ needs.test_failure.outputs.action_step_outcome }}" | ||
echo "Conclusion: ${{ needs.test_failure.outputs.action_step_conclusion }}" | ||
echo "Outcome should have been failure for an application that is not installed." | ||
exit 1 |
3 changes: 2 additions & 1 deletion
3
.../workflows/test_failure_not_installed.yml → ...test_failure_repository_not_installed.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
.github/workflows/test_installed_action.yml → ...workflows/test_organization_installed.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Tests this action success by the application already being installed on an organization | ||
|
||
name: Test Success - organization - installed | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use action | ||
id: use_action | ||
uses: ./ | ||
with: | ||
application_id: ${{ secrets.APPLICATION_ID }} | ||
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }} | ||
organization: octodemo | ||
|
||
- name: Use token to read details | ||
uses: actions/github-script@v2 | ||
with: | ||
github-token: ${{ steps.use_action.outputs.token }} | ||
script: | | ||
const repo = await github.repos.get({owner: 'octodemo', repo: 'demo-bootstrap'}); | ||
console.log(JSON.stringify(repo, null, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.