Skip to content

[github-actions] ⬆️ bump actions/checkout from 3 to 4 (#4) #42

[github-actions] ⬆️ bump actions/checkout from 3 to 4 (#4)

[github-actions] ⬆️ bump actions/checkout from 3 to 4 (#4) #42

Workflow file for this run

---
name: CI
on:
pull_request:
branches:
- main
types:
- opened
- ready_for_review
- synchronize
- reopened
push:
branches:
- main
workflow_dispatch:
inputs:
debug:
type: choice
description: Debug mode
required: false
options:
- "true"
- "false"
# Allow one concurrent
concurrency:
group: ${{ format('{0}-{1}-{2}-{3}-{4}', github.workflow, github.event_name, github.ref, github.base_ref, github.head_ref) }}
cancel-in-progress: true
env:
DEBUG: ${{ inputs.debug || secrets.ACTIONS_RUNNER_DEBUG || vars.ACTIONS_RUNNER_DEBUG || secrets.ACTIONS_STEP_DEBUG || vars.ACTIONS_STEP_DEBUG || false }}
jobs:
dog-food:
name: Dog food
runs-on: ubuntu-latest
outputs:
repos: ${{ steps.get-repos.outputs.repos }}
count: ${{ steps.get-repos.outputs.count }}
format: ${{ steps.get-repos.outputs.format }}
steps:
- name: Debug
if: ${{ env.DEBUG == 'true' }}
uses: raven-actions/debug@v1
with:
vars-context: ${{ toJson(vars) }}
secrets-context: ${{ toJson(secrets) }}
needs-context: ${{ toJson(needs) }}
inputs-context: ${{ toJson(inputs) }}
- name: Checkout
uses: actions/checkout@v4
- name: Get GitHub Token
uses: wow-actions/use-app-token@v2
id: get-token
with:
app_id: ${{ secrets.ORG_BOT_APP_ID }}
private_key: ${{ secrets.ORG_BOT_PRIVATE_KEY }}
fallback: ${{ github.token }}
- name: Get Repositories Action (json)
id: get-repos
uses: ./
with:
github-token: ${{ steps.get-token.outputs.BOT_TOKEN }}
topics: "raven-actions,composite-action"
- name: Get Repositories Action (flat)
id: get-repos-flat
uses: ./
with:
github-token: ${{ steps.get-token.outputs.BOT_TOKEN }}
topics: "raven-actions,composite-action,debug"
format: flat
- name: Test flat output
run: |
echo "Total count: ${COUNT}"
echo "Format: ${FORMAT}"
echo "Repos:"
echo -e "${REPOS}"
env:
REPOS: ${{ steps.get-repos-flat.outputs.repos }}
COUNT: ${{ steps.get-repos-flat.outputs.count }}
FORMAT: ${{ steps.get-repos-flat.outputs.format }}
test-matrix:
name: Test matrix (${{ matrix.repo.name }})
if: ${{ needs.dog-food.outputs.repos != '[]' }}
runs-on: ubuntu-latest
needs:
- dog-food
strategy:
matrix:
repo: ${{ fromJson(needs.dog-food.outputs.repos) }}
max-parallel: 2
fail-fast: false
steps:
- name: Test
run: |
echo "Total count: ${COUNT}"
echo "Format: ${FORMAT}"
echo "Repo: ${REPO}"
env:
REPO: ${{ toJson(matrix.repo) }}
COUNT: ${{ needs.dog-food.outputs.count }}
FORMAT: ${{ needs.dog-food.outputs.format }}
dog-food-matrix:
name: Dog food (${{ matrix.os }})
needs:
- test-matrix
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get GitHub Token
uses: wow-actions/use-app-token@v2
id: get-token
with:
app_id: ${{ secrets.ORG_BOT_APP_ID }}
private_key: ${{ secrets.ORG_BOT_PRIVATE_KEY }}
fallback: ${{ github.token }}
- name: Get Repositories Action
id: get-repos
uses: ./
with:
github-token: ${{ steps.get-token.outputs.BOT_TOKEN }}
topics: "github-actions,actions"
operator: AND
- name: Test
if: ${{ runner.os != 'Windows' }}
run: |
echo "Total count: ${COUNT}"
echo "Format: ${FORMAT}"
echo "Repos: ${REPOS}"
shell: bash
env:
REPOS: ${{ toJson(steps.get-repos.outputs.repos) }}
COUNT: ${{ steps.get-repos.outputs.count }}
FORMAT: ${{ steps.get-repos.outputs.format }}
- name: Test
if: ${{ runner.os == 'Windows' }}
run: |
Write-Output "Total count: ${env:COUNT}"
Write-Output "Format: ${env:FORMAT}"
Write-Output "Repos: ${env:REPOS}"
shell: pwsh
env:
REPOS: ${{ toJson(steps.get-repos.outputs.repos) }}
COUNT: ${{ steps.get-repos.outputs.count }}
FORMAT: ${{ steps.get-repos.outputs.format }}