forked from peter-murray/workflow-application-token-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from peter-murray/main
Update to latest
- Loading branch information
Showing
40 changed files
with
2,956 additions
and
1,199 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,10 +1,15 @@ | ||
{ | ||
"name": "Workspace", | ||
"image": "ghcr.io/octodemo/container-nodejs-development:base-latest", | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
"redhat.vscode-yaml", | ||
"swellaby.node-pack" | ||
], | ||
"postCreateCommand": "npm install" | ||
"image": "ghcr.io/octodemo/development-containers/javascript-nodejs-20:base-202408-r2", | ||
"postCreateCommand": "npm install", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
"redhat.vscode-yaml", | ||
"swellaby.node-pack", | ||
"vitest.explorer" | ||
], | ||
} | ||
} | ||
} |
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
44 changes: 44 additions & 0 deletions
44
.github/workflows/test_organization_installed_revocation.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,44 @@ | ||
# Tests this action success by the application already being installed on an organization | ||
|
||
name: Test Success - organization - installed with revocation | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: The name of the branch to checkout for the action | ||
required: true | ||
default: main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout specified branch | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
|
||
- name: Checkout | ||
if: github.event_name != 'workflow_dispatch' | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use action | ||
id: use_action | ||
uses: ./ | ||
with: | ||
application_id: ${{ secrets.APPLICATION_ID }} | ||
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }} | ||
organization: octodemo | ||
revoke_token: true | ||
|
||
- name: Use token to read details | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ steps.use_action.outputs.token }} | ||
script: | | ||
const repo = await github.rest.repos.get({owner: 'octodemo', repo: '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
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,69 @@ | ||
# Tests this action success by the application already being installed on the repository | ||
|
||
name: Test Success - repository - installed - with proxy | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: The name of the branch to checkout for the action | ||
required: true | ||
default: main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
# services: | ||
# squid: | ||
# image: ubuntu/squid | ||
# ports: | ||
# - 3128/tcp | ||
# volumes: | ||
# - '${{ github.workspace }}:/var/log/squid' | ||
# options: --dns 8.8.8.8 | ||
|
||
steps: | ||
- name: Checkout specified branch | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
|
||
- name: Checkout | ||
if: github.event_name != 'workflow_dispatch' | ||
uses: actions/checkout@v4 | ||
|
||
- name: Start Squid Proxy container | ||
run: | | ||
mkdir ${{ github.workspace }}/squid | ||
sudo chown proxy:proxy ${{ github.workspace }}/squid | ||
docker run -dit --name squid -p 3128:3128 -v ${{ github.workspace }}/test/squid.conf:/etc/squid/squid.conf -v ${{ github.workspace }}/squid:/var/log/squid ubuntu/squid:latest | ||
sleep 5 | ||
docker logs squid | ||
docker inspect squid | ||
curl http://localhost:3128 | ||
- name: Use action | ||
id: use_action | ||
continue-on-error: true | ||
uses: ./ | ||
with: | ||
application_id: ${{ secrets.APPLICATION_ID }} | ||
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }} | ||
https_proxy: http://localhost:3128 | ||
|
||
- name: Show Squid Logs and stop container | ||
run: | | ||
docker stop squid | ||
ls -la ${{ github.workspace }}/squid | ||
sudo cat ${{ github.workspace }}/squid/access.log | ||
- name: Use token to read details | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ steps.use_action.outputs.token }} | ||
script: | | ||
const repo = await github.rest.repos.get(context.repo); | ||
console.log(JSON.stringify(repo, null, 2)); |
72 changes: 72 additions & 0 deletions
72
.github/workflows/test_repository_installed_proxy_explict_ignore.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,72 @@ | ||
# Tests this action success by the application already being installed on the repository | ||
|
||
name: Test Success - repository - installed - with proxy - ignored | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: The name of the branch to checkout for the action | ||
required: true | ||
default: main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
# services: | ||
# squid: | ||
# image: ubuntu/squid | ||
# ports: | ||
# - 3128/tcp | ||
# volumes: | ||
# - '${{ github.workspace }}:/var/log/squid' | ||
# options: --dns 8.8.8.8 | ||
|
||
steps: | ||
- name: Checkout specified branch | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
|
||
- name: Checkout | ||
if: github.event_name != 'workflow_dispatch' | ||
uses: actions/checkout@v4 | ||
|
||
- name: Start Squid Proxy container | ||
run: | | ||
mkdir ${{ github.workspace }}/squid | ||
sudo chown proxy:proxy ${{ github.workspace }}/squid | ||
docker run -dit --name squid -p 3128:3128 -v ${{ github.workspace }}/test/squid.conf:/etc/squid/squid.conf -v ${{ github.workspace }}/squid:/var/log/squid ubuntu/squid:latest | ||
sleep 5 | ||
docker logs squid | ||
docker inspect squid | ||
curl http://localhost:3128 | ||
- name: Use action | ||
id: use_action | ||
continue-on-error: true | ||
uses: ./ | ||
env: | ||
HTTPS_PROXY: http://localhost:3128 | ||
with: | ||
application_id: ${{ secrets.APPLICATION_ID }} | ||
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }} | ||
ignore_environment_proxy: true | ||
|
||
- name: Show Squid Logs and stop container | ||
run: | | ||
docker stop squid | ||
ls -la ${{ github.workspace }}/squid | ||
echo "Access Logs:" | ||
sudo cat ${{ github.workspace }}/squid/access.log | ||
- name: Use token to read details | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ steps.use_action.outputs.token }} | ||
script: | | ||
const repo = await github.rest.repos.get(context.repo); | ||
console.log(JSON.stringify(repo, null, 2)); |
Oops, something went wrong.