Skip to content

Sandbox Test

Sandbox Test #111

Workflow file for this run

name: Sandbox Test
on:
workflow_dispatch:
schedule:
- cron: '5 5 * * *'
jobs:
test:
permissions:
id-token: write
runs-on: ubuntu-latest
environment: sandbox
steps:
- name: GetToken
id: getToken
uses: helaili/github-oidc-auth@main
with:
login: ${{ vars.LOGIN }}
endpoint: ${{ vars.ENDPOINT }}
- name: Use the token from the output
uses: actions/github-script@v6
with:
github-token: ${{ steps.getToken.outputs.scopedToken }}
script: |
github.rest.repos.get({
owner: '${{ vars.TEST_ORG }}',
repo: '${{ vars.TEST_REPO }}'
}).then((response) => {
if(!response.data.full_name) {
core.setFailed(`Failed to access repo ${{ vars.TEST_ORG }}/${{ vars.TEST_REPO }}. Response was ${response}`);
} else {
console.log('Successfully accessed repo ${{ vars.TEST_ORG }}/${{ vars.TEST_REPO }}');
}
}).catch((error) => {
core.setFailed(`Failed to access repo. Error was ${error}`);
})