Sandbox Test #71
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
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}`); | |
}) |