forked from machine-learning-apps/actions-app-token
-
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.
fix: update to newer github output style, simplify ci test
* add .gitignore file, update app path Signed-off-by: Steve Arnold <[email protected]>
- Loading branch information
Showing
6 changed files
with
75 additions
and
73 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,55 +1,36 @@ | ||
name: Tests | ||
on: [push] | ||
name: action-tests | ||
|
||
jobs: | ||
build-temp-container: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: build-temp-container | ||
run: | | ||
echo ${PASSWORD} | docker login -u $USERNAME --password-stdin | ||
docker build -t hamelsmu/app-token:temp -f prebuild.Dockerfile . | ||
docker push hamelsmu/app-token:temp | ||
env: | ||
USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: [ main ] | ||
|
||
test-container: | ||
needs: [build-temp-container] | ||
jobs: | ||
test_defaults: | ||
runs-on: ubuntu-latest | ||
name: Test local action | ||
steps: | ||
|
||
- uses: actions/checkout@master | ||
|
||
# - name: Setup tmate session | ||
# uses: mxschmitt/action-tmate@v1 | ||
# env: | ||
# INPUT_APP_PEM: ${{ secrets.APP_PEM }} | ||
# INPUT_APP_ID: ${{ secrets.APP_ID }} | ||
# To use this repository's private action, | ||
# you must check out the repository | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# tested with https://github.com/apps/fastpages-chatops | ||
- name: test | ||
id: test | ||
uses: docker://hamelsmu/app-token:temp | ||
env: | ||
INPUT_APP_PEM: ${{ secrets.APP_PEM }} | ||
INPUT_APP_ID: ${{ secrets.APP_ID }} | ||
- name: Environment | ||
run: | | ||
bash -c set | ||
- name: pre-build action image | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
echo ${PASSWORD} | docker login -u $USERNAME --password-stdin | ||
docker build -t hamelsmu/app-token -f prebuild.Dockerfile . | ||
docker push hamelsmu/app-token | ||
env: | ||
USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Get token local action | ||
id: get_token | ||
uses: ./ # Uses an action in the root directory | ||
with: | ||
APP_ID: ${{ vars.VCT_GHT_APP_ID }} | ||
APP_PEM: ${{ secrets.VCT_GHT_APP_PEM }} | ||
|
||
# tested withhttps://github.com/apps/fastpages-chatops | ||
- name: final-test | ||
uses: machine-learning-apps/actions-app-token@master | ||
with: | ||
APP_PEM: ${{ secrets.APP_PEM }} | ||
APP_ID: ${{ secrets.APP_ID }} | ||
- name: Check App Installation Token | ||
run: | | ||
echo "This token is masked: ${TOKEN}" | ||
env: | ||
TOKEN: ${{ steps.get_token.outputs.app_token }} |
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,3 @@ | ||
__pycache__/ | ||
jwt-key* | ||
pem.txt |
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,16 @@ | ||
FROM python:3.9-alpine3.16 | ||
|
||
RUN apk --no-cache add git bash | ||
|
||
ADD entrypoint.sh / | ||
ADD token_getter.py / | ||
|
||
RUN pip install \ | ||
cryptography==3.4.8 \ | ||
github3.py==1.3.0 \ | ||
jwcrypto==0.6.0 \ | ||
pyjwt==1.7.1 | ||
|
||
RUN chmod u+x /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
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 |
---|---|---|
|
@@ -16,4 +16,4 @@ branding: | |
icon: 'unlock' | ||
runs: | ||
using: 'docker' | ||
image: 'docker://hamelsmu/app-token' | ||
image: 'Dockerfile' |
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,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
echo $INPUT_APP_PEM | base64 -d > pem.txt | ||
python /app/token_getter.py | ||
python token_getter.py |
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