Repository navigation
95 lines (90 loc) · 3.41 KB
/
Copy path__pinact.yml
File metadata and controls
95 lines (90 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
# Run pinact on the org or a repo
name: Pinact
run-name: Pinact (${{ github.event.inputs.repo || 'all repos' }})
permissions: {}
on:
workflow_dispatch:
inputs:
dryRun:
description: 'Dry run mode. If true, will not push changes or create pull requests.'
required: false
default: false
type: boolean
includeForks:
description: |
Include forked repositories when processing an organization.
Has no effect when repo is specified.
required: false
default: false
type: boolean
pinactRepo:
description: 'Repository to use for pinact. Allows using a fork. Format: owner/repo.'
required: false
default: 'suzuki-shunsuke/pinact'
type: string
pinactVersion:
description: 'Version of pinact to use.'
required: false
default: 'latest'
type: string
repo:
description: |
Specific owner/repository, or an unambiguous repository name from organizations.json.
If specified, runs only on this repo instead of all registered orgs.
required: false
default: ''
type: string
jobs:
setup:
permissions:
contents: read
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.plan.outputs.result }}
config: ${{ steps.plan.outputs.config }}
steps:
- name: Checkout controller
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Plan organizations or exact repository
id: plan
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
REPOSITORY: ${{ inputs.repo }}
with:
github-token: ${{ secrets.GH_BOT_TOKEN }}
script: |
const {readOrganizations, discoverRepositories, resolveRepository, pinactConfiguration} = await import(
`${process.env.GITHUB_WORKSPACE}/.github/scripts/organization-repositories.mjs`
);
const organizations = readOrganizations();
core.setOutput('config', pinactConfiguration(organizations));
if (!process.env.REPOSITORY.trim()) {
return {include: organizations.map(owner => ({owner, repository: ''}))};
}
const repos = await discoverRepositories(github, organizations);
const repo = resolveRepository(repos, process.env.REPOSITORY);
return {include: [{owner: repo.owner.login, repository: repo.full_name}]};
pinact:
name: Pinact (${{ matrix.repository || matrix.owner }})
needs: setup
strategy:
fail-fast: false
max-parallel: 1
matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
permissions: {}
runs-on: ubuntu-latest
steps:
- name: pinact
uses: LizardByte/actions/actions/pinact@5cffab388578559f85fa83c6f7bfff244e06600d # v2026.1108.210022
with:
dryRun: ${{ github.event.inputs.dryRun }}
gitAuthorEmail: ${{ secrets.GH_BOT_EMAIL }}
gitAuthorName: ${{ vars.GH_BOT_NAME }}
githubOrg: ${{ matrix.owner }}
includeForks: ${{ github.event.inputs.includeForks }}
pinactConfig: ${{ needs.setup.outputs.config }}
pinactRepo: ${{ github.event.inputs.pinactRepo }}
pinactVersion: ${{ github.event.inputs.pinactVersion }}
repo: ${{ matrix.repository }}
token: ${{ secrets.GH_BOT_TOKEN }}