Skip to content

Commit

Permalink
fix: use actions/github-script@v6 to replace node js app
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Oct 25, 2024
1 parent 3d234e9 commit 914d512
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 124 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
VALIDATE_MARKDOWN: false
VALIDATE_JSCPD: false
VALIDATE_SHELL_SHFMT: false
VALIDATE_JAVASCRIPT_STANDARD: false
test:
name: Unit Testing and Build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -105,17 +104,27 @@ jobs:
docker push localhost:5000/hello-world:v1
- name: Build notation-akv:v1 image
run: docker build -t notation-akv:v1 -f ./test/e2e/containerized/Dockerfile.mariner .
- name: Write Federated Token File
run: |
cd ./test/e2e/containerized/get_id_token
npm install
node main.js
- name: Install OIDC Client from Core Package
run: npm install @actions/[email protected] @actions/http-client
- name: Write Id Token
uses: actions/github-script@v6
id: idtoken
with:
script: |
try {
const core = require('@actions/core')
let id_token = await core.getIDToken('api://AzureADTokenExchange')
fs.writeFileSync("./federated_token", id_token);
console.log(`Federated Token written to ./federated_token`);
} catch (error) {
core.setFailed(`Action failed with error: ${error.message}`);
}
- name: Run e2e
run: bash ./test/e2e/containerized/test.sh
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_FEDERATED_TOKEN_FILE: ./test/e2e/containerized/get_id_token/federated_token
AZURE_FEDERATED_TOKEN_FILE: ./federated_token
e2e-linux:
name: E2E testing on Linux
runs-on: ubuntu-latest
Expand Down
20 changes: 0 additions & 20 deletions test/e2e/containerized/get_id_token/main.js

This file was deleted.

81 changes: 0 additions & 81 deletions test/e2e/containerized/get_id_token/package-lock.json

This file was deleted.

16 changes: 0 additions & 16 deletions test/e2e/containerized/get_id_token/package.json

This file was deleted.

0 comments on commit 914d512

Please sign in to comment.