Skip to content

a

a #18

Workflow file for this run

name: Central repo for running language checks
on:
push:
jobs:
get-repository-languages:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/github-script@v8
id: set-languages-result
with:
script: |
return ['Python']
let { data } = await github.rest.repos.listLanguages({
owner: context.repo.owner,
repo: context.repo.repo,
});
return Object.keys(data)
outputs:
languages: ${{ steps.set-languages-result.outputs.result }}
demo_app_authentication:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v2
with:
owner: uktrade
repositories: |
github-standards
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }}
- name: Use the token
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
gh api octocat
- uses: actions/github-script@v8
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
id: trigger-python-manually
with:
script: |
const { data } = await github.rest.actions.listRepoWorkflows({
context.repo.owner,
context.repo.repo,
});
# call-workflow-passing-data:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# id-token: write
# attestations: write
# strategy:
# matrix:
# language: ${{ fromJSON(needs.get-repository-languages.outputs.languages) }}
# needs: [get-repository-languages]
# steps:
# - name: Checkout current repo
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
# - uses: actions/github-script@v8
# id: trigger-python-manually
# with:
# script: |
# await github.rest.actions.createWorkflowDispatch({
# owner: context.repo.owner,
# repo: context.repo.repo,
# workflow_id: '.github/workflows/org.python-ci.yml',
# ref: context.ref
# });
# - name: Run scan for ${{matrix.language}}
# if: matrix.language == 'Python'
# uses: ./.github/actions/scans/python
# - name: Run scan for ${{matrix.language}}
# if: matrix.language == 'Dockerfile'
# uses: ./.github/actions/scans/docker